Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.13 KB

gc_api.rst

File metadata and controls

41 lines (26 loc) · 1.13 KB

http://www.dreamface-interactive.com/img/dreamface-interactive.png

DreamFace's Graphical Control API

Graphical controls can be dynamically manipulated using an object oriented notation:

Set a CSS value

.. js:function:: css( property, value )

   :param string property: The message to display.
   :returns: void.

Example:

element.css( "color", "#ff0000" );

Invoke validation rules

.. js:function:: validate()

   :returns: the validation result.

Example:

element.validate();

Note

If the graphical control is a container, the validate function will automatically trigger

validation rules of its children controls and return a global result.

Note

To set a validation rule on a component, go to the widget builder, select the control, and click on validation rules

to open the validation rules editor. Your rule must be written in javascript and must return the result. Two types of results are accepted:

  • boolean: return true or false
  • object: return { valid: false, error_msg: "you must enter a value greather than 10" }