jfarmer
04-14-2022Cloud Apps
How to apply javascript to all pages of a table
I have the following script that modifies the values within a couple columns in this table widget and it works just fine. The issue I am having is it only applies to the first page of the table, and as soon as I change the page the changes are no longer applied. Is there an event associated with changing pages of a table I can set up in the script to make sure it runs when pages are changed?
Thanks in advance.
widget.on('domready', function(se, ev) {
var tableObject = document.getElementById("grid");
for (var r = 1, n = tableObject.rows.length; r < n; r++) {
if (tableObject.rows[r].cells[5].innerHTML == 1){
tableObject.rows[r].cells[5].innerHTML = "True";
}
else{
tableObject.rows[r].cells[5].innerHTML = "False";
};
if (tableObject.rows[r].cells[6].innerHTML == 1){
tableObject.rows[r].cells[6].innerHTML = "True";
}
else{
tableObject.rows[r].cells[6].innerHTML = "False";
}
};
});