inputEx-library

inputEx  0.7.1

inputEx-library > inputEx > inputEx.ListField
Search:
 
Filters

Class inputEx.ListField - extends inputEx.Field

Known Subclasses:
inputEx.TreeField
Meta field to create a list of other fields

Constructor

inputEx.ListField ( options )
Parameters:
options <type: 'string'> Added options:
  • sortable: Add arrows to sort the items if true (default false)
  • elementType: an element type definition (default is )
  • useButtons: use buttons instead of links (default false)
  • unique: require values to be unique (default false)
  • listAddLabel: if useButtons is false, text to add an item
  • listRemoveLabel: if useButtons is false, text to remove an item
  • maxItems: maximum number of items (leave undefined if no maximum, default)
  • minItems: minimum number of items to validate (leave undefined if no minimum, default)

Properties

arrowAnimColors - object

Colors for the animation

subFields - object

List of all the subField instances

Properties inherited from inputEx.Field:

Methods

addElement

inputEx.Field addElement ( The )
Adds an element
Parameters:
The <Any> initial value of the subfield to create
Returns: inputEx.Field
SubField added instance

getValue

Array getValue ( )
Return the array of values
Returns: Array
The array

initEvents

void initEvents ( )
Handle the click event on the add button

onAddButton

void onAddButton ( e )
Add a new element to the list and fire updated event
Parameters:
e <Event> The original click event

onArrowDown

void onArrowDown ( e )
Switch a subField with its next one Called when the user clicked on the down arrow of a sortable list
Parameters:
e <Event> Original click event

onArrowUp

void onArrowUp ( e )
Switch a subField with its previous one Called when the user clicked on the up arrow of a sortable list
Parameters:
e <Event> Original click event

onDelete

void onDelete ( e )
Called when the user clicked on a delete button.
Parameters:
e <Event> The original click event

removeElement

void removeElement ( index )
Remove the line from the dom and the subField from the list.
Parameters:
index <integer> The index of the element to remove

renderComponent

void renderComponent ( )
Render the addButton

renderSubField

inputEx.Field renderSubField ( The )
Adds a new line to the List Field
Parameters:
The <Any> initial value of the subfield to create
Returns: inputEx.Field
instance of the created field (inputEx.Field or derivative)

resetAllNames

void resetAllNames ( )
Re-set the name of all the fields (when we remove an element)

setOptions

void setOptions ( options )
Set the ListField classname
Parameters:
options <Object> Options object as passed to the constructor

setValue

void setValue ( value , [sendUpdatedEvt] )
Set the value of all the subfields
Parameters:
value <Array> The list of values to set
[sendUpdatedEvt] <boolean> (optional) Wether this setValue should fire the updatedEvt or not (default is true, pass false to NOT send the event)

validate

void validate ( )
Validate each field

Events inherited from inputEx.Field:


Copyright © 2011 Eric Abouaf All rights reserved.