JSFormBaseModel

From GeoMedia Smart Client
Revision as of 13:41, 14 February 2013 by Fbuching (Talk | contribs)

Jump to: navigation, search

NOTE: This section covers the current API used since GMSC 2013. The API documentation of older versions can be found here.

BaseModel

Depending on the type of the form item, the model provides deffirent methods and properties. The base methods and the base properties are available at any type of form model.

Methods

show()


shows the form item (and all its sub-items)

Examples

show the form field 'TEST' in the current form

IG.form.getItemById('TEST').show();


hide()


hides the form item (and all its sub-items)

Examples

hide the form field 'TEST' in the current form

IG.form.getItemById('TEST').hide();

toggle()


toggles the form item (and all its sub-items), i.e. switch its state between hidden and visible.

Examples

toggle the form field 'TEST' in the current form

IG.form.getItemById('TEST').toggle();

disable()


disables the form item (and all its sub-items), i.e. making it non-editable.

Examples

disable the form field 'TEST' in the current form

IG.form.getItemById('TEST').disable();

enable()


enables the form item (and all its sub-items), i.e. making it editable.

Examples

enable the form field 'TEST' in the current form

IG.form.getItemById('TEST').enable();

serialize()


serizalizes the form item and all its sub-items meaning that a JSON object containing all the values is created.

>>> JSON.stringify(IG.form.serialize())
"{"ConfigurationRequired":"True","Name":"sdf","Password":"sdf","Site":"GMSC_13"}"
Base functionality of all form items
show() shows the item (and all its sub-items)

<br\>

hide() hides the item (and all its sub-items)

<br\>

toggle() toggles the item (and all its sub-items)

<br\>

disable() disables the item (and all its sub-items)

<br\>

enable() (re)-enables the item (and all its sub-items)

<br\>

serialize() serializes the value of the item into a JSONObject (e.g. <input type="text" name="FIELD_ID" value="foo"> --> { FIELD_ID: "foo" }).

<br\>

isValid() validates the item against the preconfigured validators (see section "Validators") and returns true in case of a successful validator, false otherwise

<br\>

getSettings() returns the JSONObject which was given to initialize the current form item

<br\>

<br\>

Base Properties

Base properties of all form items
id() the id of the current item

<br\>

kind kind of current form item (e.g. form, tab or field)

<br\>

_jqNode access to the jQuery Object representing the form item

<br\>

<br\> <br\> <br\>