SitePen/dgrid — Issue #98: selection not reset after a remove
Author: bwa
Created: 2012-02-22 11:08:23+00:00
State: open

I have created a rest based grid and do a remove on a selected row in the grid. The DELETE is executed on the store and the row is removed form the grid, but still the grid.selection is ponting to the removed row.

The code is very simple to reproduce:

on(document.getElementById("delete"), "click", function(){
for(var id in grid.selection){
var x = prompt("Do you want to delete id: " + id+ "? Type OK in the prompt field to confirm");
if(x==="OK")
restStore.remove(id);
}
});

This works fine the first attempt, but the next attempt, without selecting any new row, it still tries to delete the same row as before and actually a new DELETE is sendt to the rest store.

I think the bug is that grid.selection should be empty after the first delete.