Blog Archive

ExtJs 4 CheckColumn dirty markup in Grid doesn't work

Issue: It works when the cell starts as checked but if it starts as unchecked then if you check it doesn't show the dirty red mark but again if you uncheck the same cell then it shows dirty which is wrong.

Solution: The issue has been resolved in the latest release of ExtJs but if you working with an older release then here is the solution
  prepareData: function(data, rowIdx, record, view, panel) {
    var obj = this.callOverridden(arguments);
    var headers   = this.gridDataColumns || this.getGridColumns(),
        headersLn = headers.length,
        colIdx    = 0,
    for (; colIdx < headersLn; colIdx++) {
      header = headers[colIdx];
      obj['-modified'] = Ext.isDefined(record.modified[header.dataIndex]) ? Ext.baseCSSPrefix + 'grid-dirty-cell' : '';
    return obj;

Source: Sencha Forum