Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Form script allows you to perform operations before the form is rendered , or to attach data model elements to get notifications. Form script also has some library functions like $Xml depending on the context. Please refer to the side bar for available library functions and scripting reference.

Form script also has a the following $Form variable with the following properties:

Code Block
$Form = {
  element : $('form'),       // jQuery form element
  refresh : function() {}    // method to re-build and render form from the scratch
  readonly : boolean,        // Specifies whether the form is in readonly or in edit mode
}

...

Attach a model element to an existing data . 

Code Block
$Xml.Bind('Person/Name', function() {
   // executed when Person/Name is changed
});

Above The above example normally works if the Name element exists in the Person element. But some elements may not exist yet when the form is rendered. For example, Bind method does not work for list items that are not yet created. If you want to attach nodes for the future elements you can use $Xml.Live method.

...