title: Dojo DataGrid loading selected items
body: <p>I have a DataGrid and want a user to select multiple items and click a button to do something with those items (such as delete).  When only a few items are selected, the deleting works, but if the user selects all the items without scrolling slowly over them, some of the selected items are null.</p>
  
  <p>I also tried grid.removeSelectedRows(), but that also doesn't work for non-loaded items.</p>
  
  <p>I tried fetching first, too:</p>
  
  <pre>
  grid.store.fetch({count:grid.rowCount,onComplete:dojo.hitch(this,function(){
    var items = grid.selection.getSelected();
    grid.selection.clear();
    if (items.length) {
      dojo.forEach(items, function(selectedItem) {
        if (selectedItem !== null) {
          grid.store.deleteItem(selectedItem); //or do something else
        }
      });
    }
    grid.sort();
  })});
  </pre>
  
  <p>Even with the fetch, there are still null items, and only the very top and bottom rows actually get deleted.</p>
  
  <p>Is there a way to load the selected items in a grid?</p>