Jack,
I want to change the background colour of modified cells in an editable grid. The code below appears to have the desired effect to the extent that it adds the "modified" class to the cell. However, some Ext code stomps on that class and once control returns to the browser the class has gone.
I think I had this working yesterday. However when I try to debug what's going on now I get lost in the bowels of your code.
A pointer on where the problem could be arising would be very helpful.
Am I going about this the right way? Is there a better way to achieve this effect?
Thanks,
Gordon
I want to change the background colour of modified cells in an editable grid. The code below appears to have the desired effect to the extent that it adds the "modified" class to the cell. However, some Ext code stomps on that class and once control returns to the browser the class has gone.
I think I had this working yesterday. However when I try to debug what's going on now I get lost in the bowels of your code.
A pointer on where the problem could be arising would be very helpful.
Am I going about this the right way? Is there a better way to achieve this effect?
Thanks,
Gordon
this.grid = new Ext.grid.EditorGrid(divId, { ds : ds, cm : cm, selModel : new Ext.grid.RowSelectionModel({singleSelect:true}), enableColLock : false, autoSizeColumns : false, monitorWindowResize : true, trackMouseOver : true, clicksToEdit : 1 }); ... this.grid.on('afteredit', this.afterEdit, this, true); ... afterEdit : function(grid, row, field, rowIndex, columnIndex){ ... var cell = this.grid.getView().getCell(rowIndex, columnIndex); cell = Ext.get(cell); cell.addClass('modified'); },

#2
![]() |
![]() In the current rev, I would recommend doing this with a renderer:
function renderDirty(val, p, record){ if(record.dirty && record.modified['some-column'] != undefined){ p.css += ' some-class'; } return val; } Note: after you save the changes, you will need to either call commit() or reject() on the individual record(s) or call commitAll()/rejectAll() on the store in order to trigger a UI update. The new rev should be available soon. ![]() |
#3
![]() |
![]() Fantastic. Thanks Jack
![]() |
#4
![]() | |
![]() Quote:
![]() |
#5
![]() |
![]() Dirty tracks if anything in the record has been modified and has not been committed. The "modified" collection has the original values for the field before any edits were made (to support rollback). If modified has an entry for a field, it has been modified.
![]() |