PDA

View Full Version : grid and the CellEditing plugin



bonetiu
20 Nov 2012, 10:04 PM
hello everyone,

first of all i'm using extjs version 4.1.1a.
i got a running grid with a data store attached that uses a data model. Inside the model i have a proxy api defined for the read/create/update/destroy operations.
The grid is using a


plugins: [
Ext.create('Ext.grid.plugin.CellEditing',{
pluginId: 'propertiesGridEditor',
clicksToEdit: 1
})
],


config feature.
Now let's go on with the problem:
- when i add data to the store, by grid.store.add({ //model fields with values}), the grid comes up with the new record added, apparently everything worked ok, but, the data model api create action is called twice with the same post data. My guess is that the cell editor plugin fires some event right after the new row has been added and i have no idea how to get around this issue.
If i take out the plugin and add a button, for example, that calls the store add method, then everything is O.K., the create method is called only once.
please help.

thanx for reading,
-Bogdan

bonetiu
20 Nov 2012, 10:31 PM
i'm sorry, but i've totally forgot to tell you that the grid store is configured with the autoSync option set to true

bonetiu
20 Nov 2012, 11:44 PM
it's funny how it happens to me that when i post a problem i'm having, i get more motivated and come up with some sort of workaround.

in other words, the issue i'm having is totally related to the autoSync config option.
i've turned it off and made two triggers: the add trigger on the store that syncs it(store.sync()) and the edit trigger on the CellEditing plugin that does the same thing (e.grid.store.sync()).
now it works perfectly.

still the autoSync problem stays. More, i figured out that on the store the add trigger is called and then two beforesync events are called.

peace,
-Bogdan