Skip to content

Instantly share code, notes, and snippets.

@itakeahike
itakeahike / EditGrid.js
Last active July 13, 2016 22:58
ExtJS 4.2: Add/remove custom filter for grid store using a checkbox on the toolbar (local filtering)
(1) Define the custom filter
me.approvedFilter = Ext.create('Ext.util.Filter', {
id: 'approvedFilter',
filterFn: function (record) {
return !record.data.approved;
}
});
(2) In the grid panel, define the checkbox in the toolbar
@itakeahike
itakeahike / ContractSearchGrid.js
Last active December 20, 2015 19:58
ExtJS 4.2: Use checkbox in grid toolbar to manage a custom filter (remote filtering and ExtDirectSpring)
(1) Define the custom filter
me.activeFilter = Ext.create('Ext.util.Filter', {
id: 'activeFilter',
property: 'onlyActive',
value: true
});
(2) In the grid panel, define the checkbox in the toolbar
@itakeahike
itakeahike / ContractSearchGrid.js
Last active December 20, 2015 19:58
ExtJS 4.2: Dynamic quick tip for grid cell
renderer: function (value, metaData, record, rowIndex, colIndex, store) {
metaData.tdAttr = 'data-qtip="' + value + '"';
return value;
}
@itakeahike
itakeahike / EditGrid.js
Last active December 20, 2015 19:58
ExtJS 4.2: Help/info button beside title in grid column
{
xtype: 'checkcolumn',
text: 'Approved' + '<img class="helpbtn" helpmsg="Check this field to approve the record" src="' + ROOT_URL + 'resources/img/information.png" />',
dataIndex: 'approved',
stateId: 'approved',
hideable: false,
width: 75
},
@itakeahike
itakeahike / app.js
Created August 8, 2013 17:48
Javascript: Global var for url root
ROOT_URL = location.href.substr(0, location.href.lastIndexOf("/") + 1);