Performing Custom View Initialization on Load

The predefined user_form_onload() event handler can be used to perform custom view initialization. If the function with this name is defined in any JS file included into the view, it will be called automatically after the view is completely loaded into the browser, and after all default view initialization is finished.

Here is a simple example of the custom form initialization:

var viewTitle;

function user_form_onload() {
viewTitle = View.title;
var tabs = View.panels.get('move-tabs');

tabs.disableTabPage('info');
tabs.disableTabPage('employee');
tabs.disableTabPage('action');
}

File: solutions/assemblies/moves/ab-ex-group-moves.js

Any view can have at most one user_form_onload() event handler. If the view includes multiple JS files, and the user_form_onload() event handler is defined in more than one of them, only the handler defined in the last JS file will be executed.