Docs
API
-
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
checkbox
Checkbox field type
Example
items: [{ ... },{ label: 'Married', type: 'checkbox', name: 'married', value: true },{ ...
Properties
cls
StringThe CSS class that will be added to field.
It is used for custom styling field.items: [{ label: 'Married', type: 'checkbox', name: 'married', cls: 'field-married' },{ ... }]
disabled
BooleanDisable field.
items: [{ label: 'Married', type: 'checkbox', name: 'married', value: true, disabled: true },{ ... //Enable field field.enable(); //Disable field field.disable();
editable
BooleanIt enables/disable editing field value.
... items: [{ label: 'Married', editable: false, type: 'checkbox', name: 'married', value: true ...
true events
ArraySet event handler to field.
... items: [{ label: 'Married', type: 'checkbox', name: 'married', value: true, events: [{ change: function(){ } }] },{ ...
id
StringIf to set id, it will be possible to get link on widget over
Fancy.getWidget
.tbar: [{ type: 'checkbox', id: 'married', value: true, label: 'Married' },{ ... }] ... var checkBox = Fancy.getWidget('married'); checkBox.set(true);
inputLabel
StringAn optional text label that will appear next to the checkbox.
... items: [{ inputLabel: 'Remember me?', type: 'checkbox', width: 336, name: 'remember', value: true },{ ...
label
StringText of field.
... items: [{ label: 'Married', type: 'checkbox', name: 'married', value: true },{ ...
labelAlign
StringAlign of label.
Values:
right
,left
,top
.... items: [{ label: 'Married', type: 'checkbox', name: 'married', value: true, labelAlign: 'right' },{ ...
left name
StringName of field over which it is possible to get value of field.
... items: [{ label: 'Married', type: 'checkbox', name: 'married', value: true, labelAlign: 'right' },{ ...
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 type
StringType of field (value - checkbox).
{ label: 'Married', type: 'checkbox', name: 'married', value: true, labelAlign: 'right' }
value
BooleanValue of field.
items: [{ label: 'Married', type: 'checkbox', name: 'married', value: true, labelAlign: 'right' ...
Methods
clear
()Clear value.
tbar: [{ type: 'checkbox', id: 'married', value: true },{ ... }] ... var checkBox = Fancy.getWidget('married'); checkBox.clear();
disable
()Disable field.
field.disable();
enable
()Enable field.
field.enable();
get
():Booleanreturn value of field.
tbar: [{ type: 'checkbox', id: 'married', value: true },{ ... }] ... var checkBox = Fancy.getWidget('married'); checkBox.get();
set
(value:Boolean)set value of field.
tbar: [{ type: 'checkbox', id: 'married', value: true },{ ... }] ... var checkBox = Fancy.getWidget('married'); checkBox.set(true);
setWidth
(value: String)Set new field width.
field.setWidth(400);
Events
change
(field, value)Change field value event.
items: [{ label: 'Married', type: 'checkbox', name: 'married', value: true, events: [{ change: function(){ }, scope: {}//not required }] ...
-
date