ludo.form.SearchField

ludo.form.


new ludo.form.SearchField(config, searchIn, delay, searchFn)

Form field designed to search in dataSource.JSONArray

Parameters:
Name Type Description
config Object
searchIn ludo.dataSource.JSONArray

Collection to search in

delay Number

Delay in seconds after key press before search is executed. Default 0.

searchFn function

Custom search fn to execute instead of plain text search. Example:
searchFn:function(record){
return record.value = this.value && record.active === true
}

note that "this" inside the function is a reference to search field.

Source:

Extends

Methods


clear()

Reset value back to the original value sent(constructor value)

Inherited From:
Source:

commit()

Update initial value to current value. These actions will always trigger a commit

  • Form or Model submission
  • Fetching new record for a ludo.model.Model
Inherited From:
Source:

disable()

Disable form element

Inherited From:
Source:
Returns:

void


enable()

Enable form element

Inherited From:
Source:
Returns:

void


focus()

Focus form element

Inherited From:
Source:
Returns:

void


getFormEl()

Get reference to input element

Inherited From:
Source:
Returns:

DOMElement


isDirty() → {Boolean}

Returns true if current value is different from original value

Inherited From:
Source:
Returns:

isDirty

Type
Boolean

isValid() → {Boolean}

Returns true when value of form element is valid, i.e. larger than minValue, matching regex etc.

Inherited From:
Source:
Returns:

valid

Type
Boolean

reset()

Reset / Roll back to last committed value. It could be the value stored by last commit method call
or if the original value/default value of this field.

Inherited From:
Source:
Returns:

void


rollback()

Alias to reset

Inherited From:
Source:

Executes search in data source

Source:

setEnabled(enabled)

Enable or disable form element

Parameters:
Name Type Description
enabled Boolean
Inherited From:
Source:

val(val) → {*}

Set or get value. If val argument is set, you will set a value, if not current value
will be returned.

Parameters:
Name Type Description
val String | Number | Array | Object | Boolean
Inherited From:
Source:
Returns:
Type
*