title: removing items from a dojo datagrid
body: <p>I am struggling with a simple dojo datagrid in my Zend Framework project.</p>
  <p>I have a list of data from a mysql table that I can display, however I want users to be able to remove selected rows (and remove them from the db). I am using the example from <a href="http://docs.dojocampus.org/dojox/grid/DataGrid#adding-and-deleting-data" rel="nofollow noreferrer">Dojo DataGrid adding and deleting data</a>. My code in my view for the datagrid looks like this.</p>
  <pre><code>&lt;div dojoType=&quot;dojo.data.ItemFileReadStore&quot; jsId=&quot;skillstore&quot; url=&quot;&lt;?php echo $this-&gt;baseUrl()?&gt;/skills/hist/&lt;?php echo $this-&gt;histid;?&gt;&quot;&gt;&lt;/div&gt;
  
  &lt;table id=&quot;skillgrid&quot; jsId=&quot;skills&quot; dojoType=&quot;dojox.grid.DataGrid&quot; store=&quot;skillstore&quot;   style=&quot;height:300px;width:500px;&quot;&gt;
   &lt;thead&gt;
      &lt;tr&gt;
          &lt;th field=&quot;skillid&quot; hidden=&quot;true&quot;&gt;&lt;/th&gt;
          &lt;th width=&quot;auto&quot; field=&quot;skill&quot;&gt;Skills&lt;/th&gt;
      &lt;/tr&gt;
          
  &lt;/thead&gt;
  &lt;/table&gt;
  &lt;div&gt;
  &lt;button dojoType=&quot;dijit.form.Button&quot; onclick=&quot;removeRows()&quot; &gt;Remove Selected Row&lt;/button&gt;
  &lt;button dojoType=&quot;dijit.form.Button&quot; onclick=&quot;addRow()&quot;&gt;Add another skill&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I've placed the code for the removing of the rows inbetween the view scripts captureStart and captureEnd tags.  The code for the removeRows() looks like this.</p>
  <pre><code>function removeRows(e){     
      var items = skillsgrid.selection.getSelected();
      
      if(items.length){
      
          dojo.forEach(items, function(selectedItem){
          
              if(selectedItem !== null){
                              
                  skillstore.deleteItem(selectedItem);
              }//endif
          });//end foreach
      
      }//end if
  }
  </code></pre>
  <p>The main problem I get is that when I select a row and click the button, firebugs complains that skillstore.deleteItem is not a function.  I have yet to try and remove the entry from the database.</p>
  <p>Any pointers would be much appreciated.</p>