I have several SlickGrids that allow User to deleteItems (actually rows). This works fine but when User wants to cancel the deletion of the rows, I am not able to redisplay the entire grid. Here's the relevent code to remove the rows:
// Modal Grid2 Remove rows
$('#removeBtnGrid2').click(function() {
for (var i = 1; i <= 2; i++) {
dataViewMG2.deleteItem(i);
}
invmodalgrid2.invalidate();
invmodalgrid2.render();
});
and here's the code I'm using to redisplay the Grid (this doesn't work):
// XXXXXXXXXXXXXXXXXXXXXXX Load selected data into MODAL GRID 2
$('#addBtnGrid1').click(function() { /// this acts as a cancel btn
dataViewMG2.beginUpdate();
dataViewMG2.setItems(modaldata2);
dataViewMG2.refresh();
invmodalgrid2.render();
dataViewMG2.endUpdate();
}
What am I doing wrong? Thanks