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
radio
Radio field type
Example
items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }] },{ ...
Properties
cls
StringThe CSS class that will be added to field.
It is used for custom styling field.items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }], cls: 'field-brand' },{ ... }]
column
BooleanPlacing radio elements in column.
... items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }] },{ ...
false columns
NumberIt is used only for radio field. It defines number of columns to place radio-s.
... items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', columns: 2, items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' },{ text: 'BMW', value: 'bmw' }] },{ ...
undefined events
ArraySet event handler to field.
... items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }], events: [{ change: function(){ } }] },{ ...
items
ArrayRadio values.
... items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }] },{ ...
label
StringText of field.
... items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }] },{ ...
labelAlign
StringAlign of label.
Values:
right
,left
,top
.... items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }], labelAlign: 'right' },{ ...
left name
StringName of field over which it is possible to get value of field.
... items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }] },{ ...
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 - radio).
{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }] }
value
BooleanValue of field.
items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }] ...
Methods
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();
get
(): StringReturns value of field.
Every radio item has text and value.
It will return not displayed text but radio item value.field.set('uk');
set
(value: String)Sets value of field.
Every radio item has text and value.
To change value needs to know radio item value.field.set('uk');
setWidth
(value: Number)Set new field width.
field.setWidth(400);
Events
change
(field, value)Change field value event.
items: [{ type: 'radio', label: 'Favorite car brand?', name: 'brand', value: 'kia', items: [{ text: 'KIA', value: 'kia' },{ text: 'Honda', value: 'honda' },{ text: 'Land Rover', value: 'lr' },{ text: 'Toyota', value: 'toyota' }], events: [{ change: function(){ }, scope: {}//not required }] ...
-
date