Disable in build filtering in grid header


I’d like to build my own server-side filtering.

Something like here

dhtmlx.com/docs/products/dhtmlxG … aging.html

I want to have my inputs in the header of the grid. I’m using the attachHeader method for this.
But when I start typing in any of the inputs in the header the grid is fireing some autosearch event.

Is’t possible to disable this behavior ?

You need to add a custom event handler and reload the grid by code. I’m doing it this way:

mygrid.attachEvent("onFilterStart", function(indexes,values){ //alert("indexes: "+ indexes + " values: " + values); jQuery.cookie("fltrs",values); mygrid.clearAndLoad("./dataProvider.php?datamode=getRows"); });

I pass the filter values in to a cookie which then gets read by the php database routine providing the XML. “values” ist a comma separated list of all the filter fields in the header (Thus, you are not able to filter by commas :frowning: ) Advantage of the cookie solution is, that you don’t have to fiddle around with URL parameters and they “survive” a page refresh also.

xlthor: I forgot to mention that I want to fire the filter on a button submit click. But anyway thanks for the tip with the cookie.

And I added this to my initialization code:

         mygrid.attachEvent("onFilterStart", function(indexes,values){
               return false;

Now when I’m start typing the event doesn’t fire up anymore. That’s fine. But now every time I change the focus between the inputs (I click in the input) the grids get reloaded.

I guess there is another event to disable ?

A pitty there is no edit button :slight_smile:

I figured out the event I was talking about is onBeforeSorting. I added custom inputs in the header using attachEvent. Now when I click in any of the inputs the onBeforeSorting gets fired. Can I dissable the onBeforeSorting for the second row in the header ?