I have managed to delete a single row of a Datagrid this way. I select a row via a checkbox, then call the function getSelectedItems() by a button at the end of the Grid to delete the selected row.
function getSelectedItems(){
require(["dijit/registry", "dojo/_base/array", "dojo/domReady!"], function(registry, array){
var items = registry.byId("GraphGrid").selection.getSelected();
if (items.length) {
array.forEach(items, function(selectedItem){
/* Delete the item from the data store: */
GraphicStore.deleteItem(selectedItem);
});
}
});
}
Update
It's a bit later and I'm not sure this Problem is still actual but i solve this Problem for me now. My Problem was nearly the same as yours. I have a Datagrid shown into a ContentPane and want to delet single Rows. Problem was that after i delete the item, the Grid wasn't refreshed. so i reload it with
grid.setStore(GraphicStore);
But the ContentPane remained empty except for the column headings. When i sort the rows, the new Grid appears. Then i set a alert to see if the Grid is still registert or not and with this alert the Grid suddenly appears! To solve this Problem i setup a Timeout, so the Grid can be fully loaded( i guess it has something to do with the loading ) and the setup the new store. Gird appears - Problem solved.
I do it this way:
setTimeout(function(){
grid.setStore(GraphicStore);
}, 1000);
Regards, Miriam