Dynamic detach/attach inline filter header


#1

I’m trying to dynamically detach/attach inline filter header in my code. Filters are not working properly after that. Does DHTMLX provide this support?


#2

Unfortunately this is the expected behavior.
Filter is attached to the html element of the header. so detaching the header you will lose the original html of the filter.
you need to clear (destruct) the filters:
mygrid.filters = [];
after detaching the header. so you are able to create new for the hew header.


#3

Hi semantik,

Thanks for your reply.

I’ve tried clearing/destructing the filters. Still only the filtered rows of grid are considered for further filtering. I don’t have any option than reloading the page.


#4

Please, make sure that you’ve unfiltered your grid data be fore the filters removing:
mygrid.filterBy(0,""); //unfilters the grid
mygrid._f_rowsBuffer = null; //clears the cache


#5

I have followed the mentioned step but still unable to get rid of ‘select_filter’. It worked for ‘text_filter’.


#6

Update:

Please, try to use:

myGrid.detachHeader(n) //n -header row index
myGrid.filterBy(0,"")
myGrid._f_rowsBuffer = null;
myGrid.filters=[];
myGrid.attachHeader(header_row_content)
myGrid.setSizes()