PDA

View Full Version : [FIXED][EXTJSIV-2376]checkcolumn dirty markup



R56
24 May 2011, 8:02 AM
Hi,

There are two problems with checkcolumn:

I : You have to include css and images files manually which is not obvious. This could/should be part of the main css and image package or at least it needs a comment about that... well... ANYWHERE would be ok.

II : The dirty markup with checkcolumn doesn't work. I can get the red corner there ONLY with the checkbox unchecked(doesn't matter what the dirty state should be for that specific cell).
Try the cell editing example here (http://dev.sencha.com/deploy/ext-4.0.1/examples/grid/cell-editing.html):
First... Find a cell where checkbox is previously checked. Try checking-unchecking. Everything works fine.
Second...
1) Find a cell where checkbox is unchecked at first.
2) Check it. It doesn't appear dirty.
3) Now uncheck that same box again. Now it shows the dirty mark even tho it's back to the original value and ergo not dirty.

Tested on Chrome 11.

If the first problem of two took me 10-15 minutes to investigate and fix(but I believe that there is a lot of people that couldn't do anything but whine about a problem like this), the second is a bug. Please look into it.

If anybody gets a different result with the "testcase" above, let me know.

Regards,
56

bcd
31 May 2011, 11:37 AM
the problem is in src/grid/header/Container.js at line 768:


obj[headerId+'-modified'] = record.modified[header.dataIndex] ? Ext.baseCSSPrefix + 'grid-dirty-cell' : '';


it should be:



obj[headerId+'-modified'] = Ext.isDefined(record.modified[header.dataIndex]) ? Ext.baseCSSPrefix + 'grid-dirty-cell' : '';

bcd
31 May 2011, 11:49 AM
and a quick fix until the next extjs release (without making changes in the main extjs file):


Ext.grid.header.Container.override({
prepareData: function(data, rowIdx, record, view, panel) {
var obj = this.callOverridden(arguments);
var headers = this.gridDataColumns || this.getGridColumns(),
headersLn = headers.length,
colIdx = 0,
header;
for (; colIdx < headersLn; colIdx++) {
header = headers[colIdx];
obj[header.id+'-modified'] = Ext.isDefined(record.modified[header.dataIndex]) ? Ext.baseCSSPrefix + 'grid-dirty-cell' : '';
}
return obj;
}
});

dongryphon
6 Jun 2011, 6:26 PM
Thanks for the report! We have a fix in the queue for 4.0.2.

dongryphon
6 Jun 2011, 6:31 PM
By the way, the official fix uses the isModified method on Model instead of isDefined.