filtering multiple checkbox column

Hi ,

I have column Relocate In Country, Relocate Out Country, and Shift Work containing checkboxes. I want to filter on any of the number of columns. The current code only work with the most recent check/unchecked checkbox.

For example:
I check on column Relocate In Country checkbox, all checked checboxes are showed. Then I check on column Relocate Out Country checkbox, all checked checkboxes (under column B ) are showed, but every checkbox under column A are showed (the column A filter is ignored). [see the attached image]

I expect to see only checked checkboxes when I check both columns.

Here is code

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;
    }
}

mygrid.attachHeader("#filter_checkbox,#filter_checkbox,#filter_checkbox");

Thanks,

Michael

Please, try to use:
self.filterBy(i,this.checked?1:0,true);
instead of
self.filterBy(i,this.checked?1:0);

Hi,

I used self.filterBy(i,this.checked?1:0,true);

but now, when I uncheck the master_checkbox, I dont see the unchecked checkboxes anymore.

Another question is how do I align the master_checkbox (seen in below image) to the center of the cell ?

For changing the align in your header you may use the style attribute of the attachHeader() method.
For example:

grid.attachHeader("A,B",["align:center;","align:center"]);

docs.dhtmlx.com/doku.php?id=dhtm … tachheader

it doesnt work because the header I want to attach is filter, not text

mygrid.setHeader("A, B, C, D");
 mygrid.attachHeader("#text_filter,#filter_checkbox,#filter_checkbox,#filter_checkbox",["align:center;","align:center","align:center;","align:center"]);

I apologize. Please, try to use the “text-align:center”. It should work well.