Search code examples
gridviewextjsflagsdirty-data

How to manually set dirty flag on specific cells in GridPanel in ExtJs


I have a grid panel that is populated with some data from store. This grid has some columns editable. Every row has a button to save editable data.

My problem is: when I edit more rows and wont to save just one row (because I don't have one button for all rows), the dirty flag (red arrow in corner) disappears from all other edited cells because in my controller I have store.commitChanges() method called. When I check the store, there are not dirty data anymore. I tried to catch rowIndex of dirty data before committing and to set committed rows again in dirty, but nothing happens. I use CellEdit plugin for editing.

My question is: Is there a way to update just one row in store and grid panel? I don't want to reload or load store again.

After editing : see image here After saving : image after saving


Solution

  • By calling the store's commitChanges you mark all records as "commited", meaning that they are not "dirty" anymore.

    You should use the model's commit method in your case, to commit the changes for each targeted record separately.