Im trying to get the selected checkboxs in invoice grid, which is working fine if I don't filter the grid or you can say before ajax request. After ajax request grid refreshes and also I can't get the selected/unselected checkboxs.
I can capture the click event on checkboxs but I want to get all of them to check which are checked & which aren't.
Here is my code
function getCheckedBoxes(chkboxName) {
var checkboxes = document.getElementsByName(chkboxName);
}
Event.observe(window, 'load', function() {
$(document).on('click', 'input[type="checkbox"]', function(event) {
var chkStatus = getCheckedBoxes("invoice_ids");
var checkboxesChecked = [];
for (var i=0; i<checkboxes.length; i++) {
if (checkboxes[i].checked) {
checkboxesChecked.push(checkboxes[i]);
}
}
// Do other stuff after that
});
});