PDA

View Full Version : grid.store.remove(); behavior



woodville
29 Aug 2012, 8:32 PM
While using "grid.store.remove();", I encounterd strange behavior as below.

------------
I'm a beginner of SA2 and Ext JS 4.
I could not find the thread on this matter.
I'm using SA 2.0.
------------

I have several rows in the grid and I tried to delete one or some of them.
1) At the first action, the last row(s) were deleted instead of the rows selected.:((
2) After the second action, the exact row(s) are deleted and this behavior continues.:)

When I checked "members" using console.log, it shows correct data.
But in the POST, at the case of 1) the rest of rows are inside except rows selected.
At the case of 2) the rows are correctly selected.


var componentM = Ext.getCmp('createGroup'); // getting id of panent component
var grid = componentM.down('#groupMembers'); // using itemid of grid
var members = grid.getSelectionModel().getSelection();

console.log(members); // just for debug

grid.store.remove(members);
grid.store.sync(members);

woodville
29 Aug 2012, 8:34 PM
The code above is for the button (for deleting rows) in the toolbar attached on the grid.