clearing the grid for OnDemandGrid

2435
3
12-04-2013 10:06 AM
DorothyMortenson
Occasional Contributor II
Hello,
I was using the sample at:
https://developers.arcgis.com/en/javascript/jssamples/fl_paging.html

There suppose to be a check if there are valid records, but it doesn't work in this sample.

I had added an input field and button to be able to do a query.  If the query is valid, I get results. If the query produces no results, the grid doesn't clear; it show the records from the previous successful records.

Anyone know how to clear the grid without clearing the query string?

Thank you.
Dorothy
0 Kudos
3 Replies
JohnathanBarclay
Occasional Contributor
Just set the store's data to an empty string then refresh the grid:

grid.store.setData("");
grid.refresh();
0 Kudos
ChristianSailer2
Occasional Contributor

Hi Johnathan

does this

  1. grid.store.setData(""); 
  2. grid.refresh();

still work?

I'm trying the same but the grid will not clear....

0 Kudos
DorothyMortenson
Occasional Contributor II
Nice! Thank you.
0 Kudos