Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by ljb on Mar 17, 2009 06:37
open dhtmlx forum
The method filterBy() which is in dhtmlxgrid_filter.js

hello,Team

There is some wrong when I using the method filterBy() whichi is in dhtmlxgrid_filter.js, The items as follows:

var mygrid = new dhtmlXGridObject('mygridbox');

..

mygrid.init();

mygrid.enableDistributedParsing(true, 20, 100);

-------------------------------------------------------------------

var finished = true;

function search(searchKey) {

if(finished ) {

    finished = false; mygrid.filterBy(i, searchKey); finished = true;

}

}

First time: the data in the grid which satisfied the first  search  conditon is large

Second time: the data in the grid which satisfied the second search condition is null

operator order:

Before the first search result load finished, I call the second search.    normal : the search result should be null .    But the result is : The grid's data load again(then the grid's data is the same as Init).

Is there any event which can make sure : start the second search after the first search finished. Because when I catch the event at outside, but It doesn't work[example:search()].

Could you give me some advise?

 

Best wishes !

ljb

2009/03/17

 

 

 

 

Answer posted by Support on Mar 17, 2009 10:04
When distributed mode used, if you issue first filtering attempt before all data parsed - filters will lock incorrect dataset as initial one, which will lead to incorrect filtering results.
You can 
a) use smartRendering mode which has not any conflicts with filtering functionality ( actually grid filters faster in such mode )
or 
b) adjust you code in such way, that first filtering executed only after all data parsed ( after onXLE event )