Select to view content in your preferred language

clearing the grid for OnDemandGrid

2532
3
12-04-2013 10:06 AM
DorothyMortenson
Deactivated User
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
Regular Contributor
Just set the store's data to an empty string then refresh the grid:

grid.store.setData("");
grid.refresh();
0 Kudos
ChristianSailer2
Regular 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
Deactivated User
Nice! Thank you.
0 Kudos