I have a multipage grid with a column of checkboxes for selecting the rows. I have a header checkbox with that.
The header checkbox has been set to only select/unselect a page at a time.
After selection the user can change the filter/sort which changes the displayed rows. The already checked/selected rows are afterwards sometimes on different pages so can be difficult to find and unselect.
So I have made a dialog box when the user 'unchecks' the header checkbox and in it I offer the choice to unselect ALL rows for entire grid, not only the visible page. This clears the selections fully, but the checkboxes on other pages are still viewed as checked even though the row is properly unselected. I thought that cb: select: linked the rows to the checkboxes for me...
cb: { header: true, all: false, select: true },
I use the following to unselect all rows with the dialog....
myGrid.on( "beforeCheck", function( event, ui ) {
if (ui.source=='header' && ui.check==false) {
$( "#dialog-uncheck" ).dialog({
resizable: false,
height:140,
modal: true,
buttons: {
"Page": function() {
$( this ).dialog( "close" );
$("#grid_php").pqGrid( "setSelection", {rowIndx:2} ); // this is a test and also doesn't activate row 2 checkbox
$("#grid_php").pqGrid( "refreshColumn", {dataIndx: "state"} ); // this doesn't seem to refresh the checkboxes
},
"All": function() {
$( this ).dialog( "close" );
$("#grid_php").pqGrid( "setSelection", null );
$("#grid_php").pqGrid( "refreshColumn", {dataIndx: "state"} );
},
Cancel: function() {
$( this ).dialog( "close" );
return false;
}
}
});
}
});
Can you recommend the correct way to refresh the checkbox view to match the selected/unselected rows?
Thank you in advance for your assistance.
Incidentally...still using v3.2.0 as I have a software deadline coming up and can't risk a full code update just yet.