Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Daniel on Sep 18, 2009 06:59
open dhtmlx forum
keeping Grid filters values in refresh

Hi

Is there any way to kept filters values when the grid is reloaded?

I want to execute loadXMLString keeping filters values and then refresh them with new content of columns

The code could be this

mygrid.loadXMLString(XMLData, calculateFooterValues);
mygrid.refreshFilters()

I see that loadXMLString reload the grid and empty the filters content/values

Is it posible to execute loadXMLString keeping filter controls (text box and combo boxes) content ?

thanks in advance
Answer posted by dhxSupport on Sep 21, 2009 03:14

You can do that with getFilterElement() method:

mygrid.load(url,function(){

      var filter=mygrid.getFilterElement(COLUMN_INDEX)

      filter.value="A"

})

To filter grid by filled value you can add following line after filter.value="A":

mygrid.filterByAll()