View Full Version : GridPanel.store.remove sending duplicate requests !

26 Mar 2011, 9:04 PM
I am seeing a problem with my GridPanel sending duplicate requests when the panel is configured with a multiselect RowSelectionModel.

My GridPanel looks like this:

var myGridPanel = new Ext.grid.GridPanel({
border: false,
store: myStore,
sm: new Ext.grid.RowSelectionModel({singleSelect: false}),
columns: columns,
tbar: [{
handler: onRefresh
text: 'Delete',
handler: onDelete

My delete handler looks like this:

function onDelete() {
var records = myGridPanel.getSelectionModel().getSelections();
if (records) {

When I select 2 rows in my grid panel and click the delete button I am seeing that records is in fact an array of 2 items, the ones I select and these are what are passed to the store's remove method. However, when I look at the network tab of the JS debugger after the remove method is called I am seeing 3 requests go to the sever with one of them being a duplicate. My store is restful. The requests going out would be something like this:




This looks like an extjs bug, I'm using 3.3.1. I haven't quite figured out why yet but even though Ext.data.Store.Ext.extend.remove records param is an Array of size 2, Ext.apply.each is iterating over the first records twice and fires two remove events for it.



26 Mar 2011, 10:56 PM
It looks like this is a problem even if I do not pass an array into store.remove(). If I have singleSelect set to false on my GridPanel, call getSelections() on the GridPanel's selection model in my button handler, and then iterate over the records I get back passing each one into store.remove() one at a time I still see the CRUD action (DELETE in this case) being performed multiple times on the 1st record. It will send a request for the 1st record X number of times where X is the number of records returned by the GridPanel.getSelectionModel().getSelections().