This topic is locked
[SOLVED]

 JavaScript OnLoad event AJAX

8/17/2017 1:34:20 PM
PHPRunner General questions
S
safesurf author

Having trouble getting the JavaScript OnLoad event with AJAX enabled on list page to work in PhpRunner 9.8. The event will work on page load but not after a search pannel query.

Sergey Kornilov admin 8/21/2017

Javascript OnLoad event will only fire once, when page is loaded initially.

S
safesurf author 8/24/2017

I was having trouble getting the code below to work like it did in version 8.1. The code works good after page load but does not work after a search panel query with bootstrap.
// Change check box anywhere on row

$(document).ready(function() {

$("tr[id^=gridRow]")

.filter(':has(:checkbox:checked)')

.addClass('selected')

.end()

.click(function(event) {

if (event.target.type !== 'checkbox') {

$(':checkbox', this).trigger('click');

}

})

.find(':checkbox')

.click(function(event) {

$(this).parents('tr:first').toggleClass('selected');

});

});
// Change row color after check box select

$(":checkbox").change(function() {

$(this).closest("tr").find("td").toggleClass("checkedHighlight", this.checked);

});

$("#chooseAll_1").change(function() {

$('#chooseAll_1').closest("table").find("tr").find("td").toggleClass("checkedHighlight", this.checked);

});
Custom CSS:

/ Change grid row color on checkbox select /

.checkedHighlight {

background-color: #C0C0C0 !important;

}

S
safesurf author 8/25/2017

If you turn off the Resizeable table columns under List page settings everything works ok.