AnsweredAssumed Answered

Clearing Data Store and Grid

Question asked by dashton on May 10, 2012
Latest reply on May 11, 2012 by svakil-esristaff
I'm using the example  Show Find Task results in DataGrid
http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/find_map_datagrid.html

I have it up and running but now I want to create a clear button, which I have, and have it clear the graphics and clear the data store and grid when the user clicks on the clear button (function clearQuery()).  So I made the grid variable a global variable and my coding isn't working and i don't know why.

Can you take a look and let me know what is wrong.  My graphics clear but my grid doesn't. 

//this should allow the user to clear grid and store  function clearQuery() {  //clear my graphics    map.graphics.clear();          //create an empty store and then bind to grid     var emptyCells = { items: "" };   var emptyStore = new dojo.data.ItemFileWriteStore({data: emptyCells});    grid = dijit.byId('grid');   grid.setStore(emptyStore);       }

Outcomes