Events in FORM application

Hello,
I used Javascript / JQuery code to color lines of a multiple lines form dynamically on event onApplicationInit() .
Now, when I navigate through the records, or after I filter records, the colors do not appear correctly, and a window with empty message pops out.
I tried to put the same JS code on events onRefresh(), onLoad(), onScriptInit() , with no success.

How can I make the JS code work not only on initial load ?
Thanks, Federico

By the way, the JQuery I use starts from

$(document).ready(function()

Maybe in event OnNavigate

🚀 Scriptcase 9.12 is now available! Check out the new features here 👉🚀 Next Monday (02/24), Scriptcase 9.12 will be released! Check out the new features before anyone else 👉