inputEx Documentation Back to homepage

inputEx Documentation > inputEx.Field 1.0.0

Class inputEx.Field

Known Subclasses:
inputEx.Group inputEx.CheckBox inputEx.ColorField inputEx.HiddenField inputEx.InPlaceEdit inputEx.ListField inputEx.PairField inputEx.RTEField inputEx.SelectField inputEx.StringField inputEx.Textarea inputEx.TypeField inputEx.UneditableField inputEx.UpperCaseField inputEx.FrenchPhone
An abstract class that contains the shared features for all fields

Constructor

inputEx.Field ( options )
Parameters:
options <Object>  - Options object (see options property)

Properties

options - Object

All the field constructors use a unique parameter "options".
  • name: the name of the field
  • required: boolean, the field cannot be null if true
  • tooltipIcon: show an icon next to the field and display an error in a tooltip (default false)
  • className: CSS class name for the div wrapper (default 'inputEx-Field')
  • value: initial value
  • parentEl: HTMLElement or String id, append the field to this DOM element

Methods

close

close()
Close the field and eventually opened popups...

disable

disable()
Disable the field

enable

enable()
Enable the field

fireUpdatedEvt

fireUpdatedEvt()
Fire the "updated" event (only if the field validated) Escape the stack using a setTimeout

getEl

<HTMLElement> getEl()
The default render creates a div to put in the messages
Returns:
    <HTMLElement> divEl The main DIV wrapper

getState

<String> getState()
Returns the current state (given its value)
Returns:
    <String> One of the following states: 'empty', 'required', 'valid' or 'invalid'

getStateString

getStateString(state)
Get the string for the given state
Parameters:
    state

getValue

<Any> getValue()
Return the value of the input
Returns:
    <Any> value of the field

initEvents

initEvents()
Initialize events of the Input

onBlur

onBlur(e)
Function called on the blur event
Parameters:
    <Event>  - The original event

onChange

onChange(e)
onChange event handler
Parameters:
    <Event>  - The original event

onFocus

onFocus(e)
Function called on the focus event
Parameters:
    <Event>  - The original event

render

render()
Default render of the dom element. Create a divEl that wraps the field.

renderComponent

renderComponent()
Render the interface component into this.divEl

setClassFromState

setClassFromState()
Set the styles for valid/invalide state

setOptions

setOptions()
Set the default values of the options

setToolTipMessage

setToolTipMessage()
Set the tooltip message

setValue

setValue(value)
Function to set the value
Parameters:
    value <Any>  - The new value

validate

<Boolean> validate()
Validation of the field
Returns:
    <Boolean> field validation status (true/false)


Events

updatedEvt

updatedEvt(value)
YAHOO custom event fired when the field is "updated"
subscribe with: this.updatedEvt.subscribe(function(e, params) { var value = params[0]; console.log("updated",value, this.updatedEvt); }, this, true);
Parameters:
    value <Any>  - The new value of the field


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