User Tools

Site Tools


documentation:applicationsettingsscripting

Scripting

You can include custom javascript code in your input forms to handle custom behavior.

For this enable “Add Custom JS” option in the Scripting Tab.

This will enable the JS Button.

Clicking on this will bring up the Javascript editor, here you can write your custom code.

There are two default event handlers that are already inserted for you.

function OnInputPageLoad(event, data) 
{
// called when Input Page is loaded.
// 
// Clear page on Back;
// var prevPageID = $(data.prevPage).attr('id');
// if (prevPageID=='OutputPage') location.reload();
}
 
function OnOutputPageLoad(event, data)
{
// called when Ouput Page is loaded.
// var prevPageID = $(data.prevPage).attr('id');
// console.log(prevPageID);
}
 
function OnBeforeSubmit()
{
// called before the Input Form is submitted.
console.log("OnBeforeSubmit");
}

OnInputPageLoad is called when the Input form is loaded. In the sample code un-commenting the last two lines will clear the input form when back button is pressed from the output form.

OnOutputPageLoad is called when the Output form is loaded.

OnBeforeSubmit is called when the before the form is supported.

Other Events that are supported are,

OnSectionExpand is called when a section is expanded.

OnSectionCollapse is called when a section is collapsed.

function OnSectionExpand(id) 
{
console.log($('#'+id).attr('cellname'));
console.log("Section Started");
}

function OnSectionCollapse(id) 
{
console.log($('#'+id).attr('cellname'));
console.log("OnSectionCollapse ");
}
documentation/applicationsettingsscripting.txt · Last modified: 2015/03/11 09:50 by admin