View Full Version : Change entire rows color when one or more colums are edited

20 Apr 2012, 10:37 AM

I have a grid panel which is in has cell editing (would like to keep cell editing and not switch to row editing). What I would like to do is when one editable cell is changed by a user, the entire row changes its background color. I know that there is the .x-grid-dirty-cell css class but that just affects the one cell being changed, I want the entire row to have its color changed. Possibly different colors depending on the cell being edited.

Similarly, when a row is added, I'd like that row to have a different color than the default. How can that be done?

I'm thinking this can be achieved with getSelectionModel() and for loops but that seems very brute force and I'm not sure on what even the for loop should be executed. Any easy ExtJS way of doing this?



20 Apr 2012, 10:19 PM
Couldn't you use getRowClass? Check whether the record is dirty and return a CSS class accordingly.

A similar approach could work for adding a row. It would depend on your specific scenario how exactly to determine a record is new, perhaps the phantom property?