Categories | Question details Back To List | ||
grid checkbox filter I would like to have a checkbox filter for a column in my grid, but if the master checkbox is selected, I want to only show rows which have their checkbox currentlyselected, and vice versa. Currently the master checkbox filter only selects or deselects all the checkboxes in the column, but does not filter them by whether they are checked or not.... Thanks. Answer posted by Support on Oct 14, 2008 01:36 Its pretty easy to define your custom filter. dhtmlXGridObject.prototype._in_header_filter_checkbox=function(t,i,c){ t.innerHTML=c[0]+"<input type='checkbox' />"+c[1]; var self=this; t.firstChild.onclick=function(e){ self.filterBy(i,this.checked?1:0); (e||event).cancelBubble=true; } } ... grid.attachHeader("#filter_checkbox,...") Answer posted by Matthew on Apr 11, 2009 07:25 Apologies my javascript isn't great but I want to include rows with the checkbox ticked if the master checkbox is ticked and to exclude ticked rows if the master checkbox is unticked - in other words the opposit of the way this code is working - how do I need to amend the code? Answer posted by dhxSupport on Apr 13, 2009 02:10 You can implement custom filtering function using filterBy() method. Please see more information here http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Data_filtering_search.html#grid_fsing |