If I am populating my grid as such how to I clear it.....when I rerun my function to get new data in a new area the last results are there untill the code finishes running....I want that to clear first before running the code.
Function updateGrid(featureSet) {
var data = arrayUtils.map(featureSet.features, function (entry, i) {
return {
id: entry.attributes.OBJECTID,
SITENAME: entry.attributes.SITENAME,
WATERBODY: entry.attributes.WATERBODY,
ACCESSAREA: entry.attributes.ACCESSAREA,
LOCATION: entry.attributes.LOCATION
};
});
// If you use a store...
dataStore = new Memory({
"data": data,
"idProperty": "id"
});
gridNoColumnSets.set("store", dataStore);
gridNoColumnSets.startup();
}
Solved! Go to Solution.
Jay,
If it is a dgrid you are talking about then you have to add an empty store to it before you go through your loop to add the new store.
function clearMyGrid()
{
var emptyCells = { items: "" };
var emptyStore = new dojo.data.ItemFileWriteStore({data: emptyCells});
gridNoColumnSets.setStore(emptyStore);
}
Jay,
If it is a dgrid you are talking about then you have to add an empty store to it before you go through your loop to add the new store.
function clearMyGrid()
{
var emptyCells = { items: "" };
var emptyStore = new dojo.data.ItemFileWriteStore({data: emptyCells});
gridNoColumnSets.setStore(emptyStore);
}
Drove me a bit bonkers for a bit till I realized I was missing
"dojo/data/ItemFileWriteStore",
Thank you much for your help....very appreciated.