Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Peter Schwer on Feb 05, 2009 13:27
open dhtmlx forum
Refreshing old queries in smart rendering

I am using the dhtmlxgrid to display the results of a structured search. For example, a user chooses items from a dropdown, which causes the dhtmlxgrid below to update with the results of the search. As more dropdowns values are specified, the search narrows down to a smaller set. The original set of items is very large (> 200,000).

I also have a 'reset' button that is intended to clear the dhtmlxgrid.

I have a script which fetches data from the backend database at 150 rows per query. I am using "results_grid.load(url, 'xml')" with a custom built url to call the script.

I call "results_grid.enableSmartRendering(true, 150)" to enable smart rendering so that the application remains responsive while gathering data.

Now, as a user narrows down his search, the dhtmlxgrid attempts to gather more results from stale queries. They get appended to the rows in the table.

Is there any way to reset the dhtmlxgrid so that it doesn't behave this way?

Answer posted by Support on Feb 06, 2009 05:05
You can delete all already loaded rows ( and reset awaited rows count ) by using 
    grid.clearAll(); //delete currently loaded rows
    grid.loadXML(new_one); //start new data loading
Answer posted by Peter Schwer on Feb 06, 2009 07:49
The specified approach didn't work. When I used 'clearAll' followed by 'loadXML', a new query result is loaded into the grid. In the background requests continue to be sent for stale query results (with a row-count that applies to the new query).

I've attached my code file. The relevant code is on line 197.
Attachments (1)