title: Filter Datagrid onLoad
body: <p>My data grid successfully filters when I select a month from a dropdown list, however when I try to filter it onLoad it just doesn't filter. The dropdown successfully displays the current month, and the grid should also show the current month data.</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
          dojo.require("dojox.grid.DataGrid");
          dojo.require("dojox.data.XmlStore");
          dojo.require("dijit.form.FilteringSelect");
          dojo.require("dojo.data.ItemFileReadStore");
          dojo.require("dojo.date");
  
          theMonth = new Date();
  
          dojo.addOnLoad(function()
              {
                  dojo.byId('monthInput').value = month_name[(theMonth.getMonth()+1)];
                  var filterString='{month: "' + theMonth.getMonth() + '"}';
                  var filterObject=eval('('+filterString+')');
                  dijit.byId("eventGrid").filter(filterObject);
              }
          );
  
          var eventStore = new dojox.data.XmlStore({url: "events.xml", rootItem: "event", keyAttribute: "dateSort"});
  
          function monthClick() { 
              var ctr, test, rtrn;
  
              test = dojo.byId('monthInput').value;
  
              for (ctr=0;ctr&lt;=11;ctr++)
              {
                  if (test==month_name[ctr])
                  {
                      rtrn = ctr;
                  }
              }
  
              var filterString='{month: "' + rtrn + '"}';
              var filterObject=eval('('+filterString+')');
  
              eventGrid.setQuery(filterObject);
          }
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body class="tundra"&gt;
     &lt;div id="header" dojoType="dijit.layout.ContentPane" region="top" class="pfga"&gt;&lt;/div&gt;
     &lt;div id="menu" dojoType="dijit.layout.ContentPane" region="left" class="pfga"&gt;&lt;/div&gt;
  
     &lt;div id="content" style="width:750px; overflow:visible" dojoType="dijit.layout.ContentPane" region="center" class="pfga"&gt;
          &lt;div dojotype="dojo.data.ItemFileReadStore" url="months.json" jsID="monthStore"&gt;&lt;/div&gt;
  
          &lt;div id="pagehead" class="Heading1" &gt;Upcoming Events&lt;/div&gt;
          &lt;p&gt;
          &lt;input dojoType="dijit.form.FilteringSelect" store="monthStore" searchAttr="month" name="id" id="monthInput" class="pfga" onChange="monthClick()" /&gt;
          &lt;/p&gt;
          &lt;table dojoType="dojox.grid.DataGrid" store="eventStore" class="pfga" style="height:500px; width:698px" clientSort="true" jsID="eventGrid"&gt;
            &lt;thead&gt;
              &lt;tr&gt;
                &lt;th field="date" width="80px"&gt;Date&lt;/th&gt;
                &lt;th field="description" width="600px"&gt;Description&lt;/th&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;th field="time" colspan="2"&gt;Details&lt;/th&gt;
              &lt;/tr&gt;
            &lt;/thead&gt;
          &lt;/table&gt;
  
     &lt;/div&gt;     
  
     &lt;div id="footer"&gt;&lt;/div&gt;
  </code></pre>