inputEx Documentation Back to homepage

inputEx Documentation > inputEx 1.0.0

Static Class inputEx

The inputEx global namespace object.

Properties

messages - Object

Associative array containing field messages

regexps - Object

Associative array containing common regular expressions

spacerUrl - String

Url to the spacer image. This url schould be changed according to your project directories

stateEmpty - String

Field empty state constant

stateInvalid - String

Field invalid state constant

stateRequired - String

Field required state constant

stateValid - String

Field valid state constant

typeClasses - Object

Hash between inputEx types and classes (ex: inputEx.typeClasses.color = inputEx.ColorField)
Please register the types with the registerType method

Methods

buildField

static <inputEx.Field> buildField(fieldOptions)
Build a field from an object like: { type: 'color' or fieldClass: inputEx.ColorField, inputParams: {} }
The inputParams property is the object that will be passed as the options parameter to the field class constructor.
If the neither type or fieldClass are found, it uses inputEx.StringField
Parameters:
    fieldOptions <Object> 
Returns:
    <inputEx.Field> Created field instance

cn

static <HTMLElement> cn(tag, domAttributes, styleAttributes, innerHTML)
Helper function to create a DOM node. (wrapps the document.createElement tag and the inputEx.sn functions)
Parameters:
    tag <String>  - The tagName to create (ex: 'div', 'a', ...)
    domAttributes <Object> optional - see inputEx.sn
    styleAttributes <Object> optional - see inputEx.sn
    innerHTML <String> optional - The html string to append into the created element
Returns:
    <HTMLElement> The created node

getFieldClass

static getFieldClass(type)
Returns the class for the given type ex: inputEx.getFieldClass("color") returns inputEx.ColorField
Parameters:
    type

getType

static <String> getType(FieldClass)
Get the inputex type for the given class (ex: inputEx.getType(inputEx.ColorField) returns "color")
Parameters:
    FieldClass <inputEx.Field>  - An inputEx.Field or derivated class
Returns:
    <String> returns the inputEx type string or null

registerType

static registerType(type, field)
When you create a new inputEx Field Class, you can register it to give it a simple type. ex: inputEx.registerType("color", inputEx.ColorField);
Parameters:
    type
    field

sn

static sn(el, domAttributes, styleAttributes)
Helper function to set DOM node attributes and style attributes.
Parameters:
    el <HTMLElement>  - The element to set attributes to
    domAttributes <Object>  - An object containing key/value pairs to set as node attributes (ex: {id: 'myElement', className: 'myCssClass', ...})
    styleAttributes <Object>  - Same thing for style attributes. Please use camelCase for style attributes (ex: backgroundColor for 'background-color')



Copyright (c) 2008 Eric Abouaf. All rights reserved.
Generated by JsDoc Toolkit 1.4.1 on Wed, 07 May 2008 10:26:29 GMT.