I am using beforeCheckChange
listener for checkColumn
in extjs grid cell editing.
Once unchecked, I want remove the dirty flag for this cell. So I am trying to remove "x-grid-dirty-cell"
Cls, using cell div
id.
Ext.select("ext-gen2654").removeCls('x-grid-dirty-cell');
Following is listener
listeners: {
beforecheckchange: me.onCheckcolumnBeforeCheckChange
}
onCheckcolumnBeforeCheckChange: function(comp, rowIndex, checked, eOpts) {
Ext.select("ext-gen2654").removeCls('x-grid-dirty-cell');
}
How do I get the div
id for this cell only?
Let me know if we have any alternative to remove dirty record after uncheck.
Edited- display checkbox for alternative records
Ext.getCmp('grid').gridColumns[0]= {
xtype: 'checkcolumn',
dataIndex: 'SELECT',
width: 55,
stopSelection: true,
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
if(row%2==0){ // i need to display alternative checkbox
var cssPrefix = Ext.baseCSSPrefix,
cls = cssPrefix + 'grid-checkcolumn';
if (this.disabled || value == 'N') {
metaData.tdCls += ' ' + this.disabledCls;
}
if (!value) {
cls += ' ' + cssPrefix + 'grid-checkcolumn-checked';
}
return '<img class="' + cls + '" src="' + Ext.BLANK_IMAGE_URL + '"/>';
}
}
,
try listener code to remove dirty mark, but no luck
onCheckcolumnBeforeCheckChange: function(comp, rowIndex, checked, eOpts) {
var store=Ext.getCmp('grid').getStore();
var record= store.getAt(rowIndex);
if(checked==true){
record.dirty= false;
record.commit();
store.commitChanges();
}