To successfully use Grid, auto sync store, and rowediting plugin in ExtJS 4, there are several points need to be highlighted. I listed them as below,
- In your Model class, you have to either define a hardcoded 'id' property or use 'idProperty' to specify one column as 'id'.
- You server side code need to return processed records back to browser. I tried only send back "id" in "data" part. But, it is not successful.
- Be aware that the format of record in the "data" has JSON format.
- Be sure to implemented at least one Validator in your Model class because, in ExtJS source code
AbstractStore.js
, you can find the following code, which may always return true for a new created record in RowEditing plugin when the store is set asautoSync = true
/** * @private * Filter function for new records. */ filterNew: function(item) { // only want phantom records that are valid return item.phantom === true && item.isValid(); },
Most likely, we wont use auto sync store in real product. But, this example could be a good start.