How to set the attachHeader filter value for checkbox column

I have a grid with 2 columns - one string and one checkbox (database integer type with values of 0 or 1).
Each column has an “attachHeader” filter set.
I want to be able to store the current filter values so as when the user navigates away from the page and then returns to the page (same session or a different session), I can then repopulate the filter, programmatically - in the onXLE event.

I can set/repopulate the filter value for the string column but I can’t determine how to set it for the checkbox column.

Code snippet below:

<rows> <row id="1"> <cell>Role1</cell> <cell>1</cell> </row> <row id="4"> <cell>Role2</cell> <cell>1</cell> </row> <row id="41"> <cell>Role3</cell> <cell>0</cell> </row> </rows>

. . .
myGrid = myLayout.cells("a").attachGrid();
myGrid.setImagePath("codebase/imgs/");
myGrid.setHeader("Role Str,Status Chkbox");
myGrid.setColumnIds("xrole,xstat");
myGrid.setInitWidths("100,100");
myGrid.setColAlign("left,center");
myGrid.setColTypes("ed,ch");
myGrid.setColSorting("str,str");
myGrid.enableMultiselect(false);
myGrid.attachHeader("#text_filter,#combo_filter");

// dropdown for the combo_filter
cbbStatus = myGrid.getCombo(1);
cbbStatus.put("0","No");
cbbStatus.put("1","Yes");

myGrid.init();
myGrid.attachEvent("onXLE",function(){
	// Once the data is loaded, set the filter value for the 1st column,
	myGrid.getFilterElement(0).value="Emplo";
	// BUT how to set the filter for the checkbox column??
});

myGrid.load("getData.php?uid="+(new Date()).valueOf());
. . .

Sorry, I forgot to show the “filterByAll()” in my original post.

I’ve found a way to set the filter internally (myGrid.filters[1][0].value = “1”:wink: but this doesn’t show on the filter dropdown so I suspect this is not the correct way.

...
myGrid.init();
myGrid.attachEvent("onXLE",function(){
	myGrid.getFilterElement(0).value="Emplo";
	myGrid.filters[1][0].value = "1";  // Works internally but doesn't show on dropdown
	myGrid.filterByAll();
});
...

You may try to use the following solution:
mygrid.getFilterElement(1).DOMParent.combo.selectOption(1) // 1 - index of the option in the list

Thank you very much. That’s perfect!

How can I determine an onchange event for both:

myGrid.getFilterElement(0).value="Emplo";
myGrid.getFilterElement(4).DOMParent.combo.selectOption(2);

Apologies. Just worked out I can use the:

grid.attachEvent("onFilterEnd", function(elements){
    //your code here
});