On Render
The On Render event fires after the Before Render event has collected data and that data has been painted on the screen.
This is a client-side JavaScript event and jQuery is loaded by default.
Note: This event can fire multiple times (eg ajax-loading more records into a table by clicking the “more…” link will fire this event with each successive load).
Available Variables
For security, there is limited data available since it’s exposed in the client. The following variables are available:
target
- jquery DOM wrapper of the current screen
my_variables
- Array of keys and values you have set previously in a server-side ProcScript event - cannot be changed here
Please note that any variables you set in JavaScript will not persist and will not be passed back to the server.
Examples
Maybe saved the current item status to a variable and want to make the form background red if it’s “Critical”:
if ( my_variables.status == "Critical" ) {
$("form").css("background", "red");
}
Or maybe use saved the authenticated user’s role in a variable and want to hide the Save button if they’re not a manager:
if ( my_variables.user_role != "manager" ) {
$("button.primary").remove();
}
Helpers
There is a helper class called PfJs
that you can call to do numerous things.
Full documentation for PfJs is found here: