-
Config
- barHeight
-
bbar
- bbarHeight
-
buttons
- buttonsHeight
- cls
- defaults
- draggable
-
events
-
footer
- height
- id
- i18n
-
items
- column
-
data
- defaults
- disabled
- displayKey
- editable
- emptyText
- events
-
format
- itemCheckBox
- inputHeight
- inputLabel
- inputWidth
- label
- labelAlign
- labelWidth
- listItemTpl
- leftTpl
- leftWidth
- max
- min
- minListWidth
- multiSelect
- multiToggle
- name
- showPassTip
- spin
- step
- subSearch
- tabIndex
- tip
- type
- value
- valueKey
- vtype
- width
-
lang
-
date
- method
- modal
- params
- renderOuter
- renderTo
- scrollable
- shadow
-
subTitle
-
subTBar
- allowToggle
- action
- cls
- data
- disabled
- displayKey
- editable
- emptyText
- enableToggle
- events
- format
- handler
- hidden
- id
- imageCls
- inputHeight
- itemCheckBox
- leftTpl
- leftWidth
- max
- menu
- minListWidth
- multiSelect
- multiToggle
- paramsMenu
- paramsText
- pressed
- spin
- step
- subSearch
- text
- tip
- toggleGroup
- type
- valueKey
- vtype
- width
- subTBarHeight
-
tbar
- allowToggle
- action
- cls
- data
- disabled
- displayKey
- editable
- emptyText
- enableToggle
- events
- format
- handler
- hidden
- id
- imageCls
- inputHeight
- itemCheckBox
- leftTpl
- leftWidth
- max
- menu
- minListWidth
- multiSelect
- multiToggle
- paramsMenu
- paramsText
- pressed
- spin
- step
- subSearch
- text
- tip
- toggleGroup
- type
- valueKey
- vtype
- width
- tbarHeight
-
title
date
Date field type
Example
items: [{ type: 'date', label: 'Birthday', name: 'birthday'
Properties
cls
StringThe CSS class that will be added to field.
It is used for custom styling field.items: [{ type: 'date', label: 'Birthday', name: 'birthday', cls: 'field-birthday' },{ ... }]
disabled
BooleanDisable field.
items: [{ type: 'date', label: 'Birthday', name: 'birthday', disabled: true },{ ... //Enable field field.enable(); //Disable field field.disable();
editable
BooleanIt enables/disable editing field value.
... items: [{ editable: false, type: 'date', label: 'Birthday', name: 'birthday' ...
true events
ArraySet event handler to field.
... items: [{ type: 'date', label: 'Birthday', name: 'birthday' events: [{ change: function(){ } }] },{ ...
disabled
BooleanDisable field.
items: [{ type: 'date', label: 'Birthday', name: 'birthday', disabled: true },{ ...
format
MixedFormatting.
{ label: 'Birthday', name: 'birthday', value: item.birthday, format: { read: 'Y.m.d', write: 'Y.m.d', edit: 'd.m.Y' }, type: 'date' }
inputHeight
NumberField input height. It influence only on fields with input element inside.
{ label: 'Birthday', name: 'birthday', value: item.birthday, format: { read: 'Y.m.d', write: 'Y.m.d', edit: 'd.m.Y' }, type: 'date', inputHeight: 35 }
label
StringText of field.
... items: [{ type: 'date', label: 'Birthday', name: 'birthday' },{ ...
labelAlign
StringAlign of label.
Values:
right
,left
,top
.... items: [{ type: 'date', label: 'Birthday', name: 'birthday' labelAlign: 'right' },{ ...
left max
DateThe maximum allowed date value for this field.
... items: [{ type: 'sale', label: 'Sale', name: 'sale', max: new Date() //today },{ ...
min
DateThe minimum allowed date value for this field.
... items: [{ type: 'sale', label: 'Sale', name: 'sale', max: new Date(), //today min: new Date(2017, 1, 1) },{ ...
name
StringName of field over which it is possible to get value of field.
... items: [{ type: 'date', label: 'Birthday', name: 'birthday' },{ ...
tabIndex
NumberSets a DOM tabIndex for this field.
tabIndex may be set to -1 in order to remove the field from the tab rotation.
Available for fields with input.{ type: 'date', label: 'Birthday', name: 'birthday', tabIndex: 2 }
undefined type
StringType of field (value - date).
{ type: 'date', label: 'Birthday', name: 'birthday' }
tip
String|NumberField tip.
}, { label: 'Name', tip: 'Name', emptyText: 'Name', name: 'name' }, { label: 'SurName', tip: '{value}', emptyText: 'SurName', value: 'Johnson', name: 'surname' }, { label: 'E-mail', emptyText: 'E-mail', name: 'email', tip: function(field, value, label) { return field.label; } }, {
Sample on JSFiddle
undefined value
DateValue of field.
items: [{ type: 'date', label: 'Birthday', name: 'birthday', value: new Date() ...
Methods
blur
()Blur field.
field.blur();
clear
()Clear value.
tbar: [{ type: 'number', id: 'employee', value: 1 },{ ... }] ... var numberField = Fancy.getWidget('employee'); numberField.clear();
disable
()Disable field.
field.disable();
enable
()Enable field.
field.enable();
focus
()Focus field.
field.focus();
get
():Stringreturn value of field.
field.get();
set
(value: Date)Sets value of field.
field.set(new Date(2017, 2, 17));
setWidth
(value: Number)Set new field width.
field.setWidth(400);
validation
():BooleanForce field validation.
It returns validation status.field.validation();
Events
blur
(field)Losing focus from field event.
items: [{ type: 'date', label: 'Birthday', name: 'birthday', events: [{ blur: function(){ } }] ...
change
(field, value)Change field value event.
items: [{ type: 'date', label: 'Birthday', name: 'birthday', events: [{ change: function(){ }, scope: {}//not required }] ...
focus
(field)Focus field event.
items: [{ type: 'date', label: 'Birthday', name: 'birthday', events: [{ focus: function(){ } }] ...
-
date