dhtmlxtreegrid reloading and filtering

Hi,

I’m experiencing some trouble around the combination of loading data and filtering within a dhtmlxtreegrid. To demonstrate the issue, see the example below.

In this example, the [reload] button loads a different XML file and the [filter] button simply filters out the currently selected item based on its value in column ‘B’.

All is well when I click [reload], followed by [filter], but when I first [filter] the first data set, then [reload] and then [filter] the second data set, then the results are wrong, because the grid seems to be filtering items in the FIRST data set.

This only seems to happen when the ‘preserve’ flag in ‘filterBy’ is set to false.

What am I doing wrong here?
Kind regards,

Robert.

Archive.zip (1.93 KB)

This this known issue of filter buffer. docs.dhtmlx.com/doku.php?id=dhtm … iltering&s[]=grid&s[]=filter#adding_deleting_rows_in_filtering_mode
To fix it change your code like this:

function doReload() { mygrid.clearAll(); mygrid.loadXML("Archive/test_list_2.xml",function(){ mygrid._f_rowsBuffer = null; //clear cache });

Works like a charm, thanks!