I have a special use case where data come from a single table column containing a JSON. I'm loading the contents of this JSON into a ExtJS store and after changing or adding new items to the store I have to sync with the server.
The front end send a JSON array like this: {"data":[{"name":"Tony","age":"10","id":"users.1"}]}
.
ExtJS sends the generated internal ID, is it possible to every time I sync I always send the same ID, lets say 10
instead of the generated ID?
You can set a property in which ExtJS will send it's own generated id, and ignore it on the server side, and put your desired value (10) in the id
field.
To do so, add this to your Model definition:
Ext.define('MyModel', {
clientIdProperty: 'clientId',
});