1
votes

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 hereAfter saving : image after saving

1
In you controller you can try to commit only the record on the row that has been clicked and this way all other records will remain dirty. Is this what you mean by "update just one row"?scebotari66
@scebotari66 Thanks man for fast respond :). Yes this was what I was looking for. I saw this method in Sencha, but I tried with store.commit() end error appears... Instead, I should to call store.getAt(rowIndex).commit(). How can I to put your answer as Resolve / best answer?Nemanja Stojanovic
Great to know it helped! I will put it in an answer.scebotari66

1 Answers

1
votes

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.