PDA

View Full Version : How to make dirty value non-dirty



zerkms
29 Apr 2012, 8:02 PM
I have a grid with CellEditing plugin enabled.

The question is: how to make the value in the cell not-dirty, and remove the dirty-triangle-indicator

ps: I use ajax proxy as a data store and `commit()` is not suitable in my case, since I need all modifications (as well as deletions and creations) to be sent in a single request, so I manage it manually. So I send it to server successfully and the only issue is how to tell to the store that local data is the most actual and not dirty.

vietits
29 Apr 2012, 8:07 PM
Your server script should return {success: true} to the client to tell it everything is successful and the rest will be done by the framework. With creating request, your returned data should return newly created records with id also.

zerkms
29 Apr 2012, 8:10 PM
Your server script should return {success: true} to the client to tell it everything is successful and the rest will be done by the framework. With creating request, your returned data should return newly created records with id also.
I don't use store facilities on persisting the data. So the question is: how to make grid and store thinking that current data is not dirty?

I cannot use it because it performs separated requests for updated, added and deleted rows, which is not appropriate in my case

vietits
29 Apr 2012, 10:44 PM
So you have to do all the things manually. On callback of Ext.Ajax. request(), you have to:
- Update id for newly created records.
- Commit all records.

zerkms
29 Apr 2012, 10:56 PM
So you have to do all the things manually. On callback of Ext.Ajax. request(), you have to:
- Update id for newly created records.
- Commit all records.

What is `commit`? Is it a store method?

vietits
29 Apr 2012, 11:07 PM
With Ext 4.1.0, store has a method name <store>.commitChanges() which in fact calls commit() on each modified record.With Ext 4.0, you have to commit all records returned by <store>.getUpdatedRecords() and <store>.getNewRecords().

zerkms
30 Apr 2012, 12:34 PM
Ok, thank you