Categories | Question details Back To List | ||
Dataprocessor - set only changed cells to bold? I'm using Grid with DataProcessor in a configuration dialog. Using manual updates, so user can change multiple things at once. I noticed that when a value is changed, all cells in that row get bold text. I need only the cells that actually were edited in that row to be bold, and the rest to retain original style. Is that possible? Answer posted by Alex (support) on Jul 07, 2009 01:44 Data Processor doesn't provide a ready solution. You can try to use "onRowMark" event to block default Data Processor's marking. dp.attachEvent("onRowMark",function(rowId,state,mode){ /*state:true/false;mode can be inserted, updated,deleted*/ Here you can find the changed cells in the row and mark them. Answer posted by Kathy on Jul 07, 2009 03:28 Is there functionality in the grid to tell me which cells are changed compared to initial load, or will I have to keep parallel data structure to use this solution? Answer posted by dhxSupport on Jul 07, 2009 03:32 To find out if cell was changed you can use wasChanged() cell's object method: myDataProcessor.attachEvent("onRowMark",function(id,state,mode){ if(state&&mode=="updated"){ mygrid.forEachCell(id,function(obj){ if (obj.wasChanged()) obj.cell.style.fontWeight="bold"; }); return 0; } return true; }) Answer posted by Kathy on Jul 07, 2009 03:48 Thank you. Works like a charm for ed, edn and combo excells. ch presents a problem, as check box doesn't get bold. Any suggestions? Is there a way to get excell type for a cell, so I could maybe play with color or size..? Answer posted on Jul 07, 2009 04:10 You can get type of the column using getColType(cInd) method: mygrid.forEachCell(id,function(obj){ var type=mygrid.getColType(obj.cell._cellIndex); ... }); Also you can check if cell is checkbox using isCheckbox() method: mygrid.forEachCell(id,function(obj){ if (obj.isCheckbox()) { ... }); |