I have a nice working Ext.grid.Panel, with column headers you can click on to "automatic" sort. The store has "autoSync: true". I have a button "new", when the user clicks on it, it creates an empty record without the id property:
onAddClick: function(){
this.down('#new').setDisabled(true);
var rec = new GroupeSynergies.data.Partenaire({
/* Valeurs par défaut des colonnes */
description: 'Nouveau partenaire'
});
this.store.insert(0, rec);
},
I insert the record in the #0 position, because I know that it'll be automatically synced (and that's what's happening actually). The problem is: if you click on the "id" column, it's sorted by id asc, if you click again, reverse order.
Then you click on the button "New", it creates empty new record, sends it to the server, and gets the resulting record with the id field completed, updates the grid, but... don't take in account the sort: when it's synced, the returned id is very high and it stays on the top, no matter what the sort order is. What am I doing wrong?
Thank you very much
(PS I'm asking at stackoverflow because Sencha's forum seems to be overwhelmed)