ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: niketnaik on November 21, 2022, 10:56:49 am
-
I want to access selected checkboxes from outside of the grid. Check the attachment. I tried using below code
var array = []
var checkboxes = document.querySelectorAll('input[type=checkbox]:checked');
for (var i = 0; i < checkboxes.length; i++) {
array.push(checkboxes[i].value);
}
But this code skips the values of checkboxes which are on next page or in the scroll down area. I want to access all the checkboxes.
-
Please check this example: https://paramquery.com/pro/demos/checkbox_id
var checked = grid.Checkbox('state').getCheckedNodes().map(function(rd){
return rd.id
})
alert(checked);
where grid is js instance of grid.
If you don't have access to the js instance, then you can use jQuery selector to get to it,
var grid = $( selector of grid ).pqGrid( 'instance' );
More about grid variable here: https://paramquery.com/pro/tutorial#topic-special-vars
-
Worked