Fields Methods

Method Input Output Info Help
container() - object Get Parent Field Container (or null if none). help
bind() - object Get the current field bindings. help
clear() - void Clear the Field or Nested Fields to empty value. help
reset() - void Reset the Field or Nested Fields to default value. help
focus() - void Programmatically set focus on the field. help
blur() - void Programmatically blur the field if focused. help
trim() - void Apply trim() to the field value if is string. It does not trigger onChange Event Hook help
invalidate(msg) (string) void Mark the field as invalid. Pass an optional error message or a default error will be shown. help
resetValidation() (boolean) void Reset the field validation status. Pass true for deep reset. -
showErrors(bool) (boolean) void Show or Hide Field Error Messages. -

Shared Methods

Method Input Output Info Help
select(path) (string) object Field Selector. Can be chained. help
update(obj) (object) void Update Fields Values. Will create new fields auomatically. help
submit(obj) (object) promise Perform fields validation. After successful validation triggers onSuccess event and onError event in case of validation error. help
validate() - promise Check if the field is valid and return a promise. help
validate(path) (string) promise Takes a field path in input. Check if the field and nested fields are valid and return a promise. help
validate(opt) (object) promise Takes a an object in input with related or showErrors options. help
validate(path, opt) (string, object) promise Takes a field path as first arg. and object as second arg. with related or showErrors options. help
check(computed) (string) boolean Check field computed property. help
check(computed, deep) (string, boolean) boolean Check all nested fields computed property if deep is true help
get() - object Get all field and nested fields data with all props and computed values. help
get(prop) (any) object Get all field filtering by certain props (string or array). help
set(val) (any) void Set field value. Takes the value. help
set(obj) (object) void Provide an object to set nested fields values. help
set(prop, val) (string, any) void Set field property. Takes prop key and prop value. help
set(prop, obj) (string, object) void Provide a prop key and object to set nested fields properties. help
has(key) (string) boolean Provide Field key to check if exist. help
map(callback) (function) array Map Nested Fields help
reduce(callback, acc) (function, any) any Reduce Nested Fields help
each(callback) (function) void Iterates over fields and nested fields recursively and invokes a callback which get each field in input. help
add(obj) (any) any Add a Field or Nested Fields. help
del(key) (any) void Delete a Field or Nested Fields by key or path. help
move(fromIndex, toIndex) (number, number) void Move an array field item from one index to another. Delegates to ArrayMap.move(). help
observe(obj) (object) function Define a MobX Observer on Field Props or Field Map. Returns a disposer function. help
intercept(obj) (object) function Define a MobX Interceptor on Field Props or Field Map. Returns a disposer function. help

$('path') is an alias of select(path).

Helpers

Property Input Output Info Help
values() - object Get Field & Nested Fields Values. help
errors() - object Get Field & Nested Fields Errors. help
labels() - object Get Field & Nested Fields Labels. help
placeholders() - object Get Field & Nested Fields Placeholders. help
defaults() - object Get Field & Nested Fields Default Values. help
initials() - object Get Field & Nested Fields Initial Values. help
types() - object Get Field & Nested Fields Type. help

Event Handlers

Property Input Output Info Help
sync(e) - object Update the value of the field. help
onChange(e) - object Update the value of the field. (alias of sync(e)) help
onToggle(e) - object Update the value of the field. (alias of sync(e)) help
onFocus(e) - object Track the focused property of the field. help
onBlur(e) - object Track the touched property of the field. help
onSubmit(e) - object Sub-Form Submission: Validate the fieldset and call onSuccess(fieldset) or onError(fieldset). help
onClear(e) - object Clear all the Fields and Nested Fields to empty value. help
onReset(e) - object Reset all the Fields and Nested Fields to default value. help
onAdd(e) - object Add a Field or Nested Fields. help
onDel(e) - object Delete a Field or Nested Fields. help
onKeyUp(e) - object Executed on field key up help
onKeyDown(e) - object Executed on field key down help
onDrop(e) - object Handle file drop events when type: 'file'. Access files via field.files. help

All Event Handlers takes the Proxy object in input.

results matching ""

    No results matching ""