checkbox

Checkbox field type

Example


items: [{
...
},{
  label: 'Married',
  type: 'checkbox',
  name: 'married',
  value: true
},{
...

Properties

events

Array

Set event handler to field.


...
items: [{
  label: 'Married',
  type: 'checkbox',
  name: 'married',
  value: true,
  events: [{
    change: function(){
      
    }
  }]
},{
...

id

String

If to set id, it will be possible to get link on widget over Fancy.getWidget.


tbar: [{
  type: 'checkbox',
  id: 'married',
  value: true
},{
...
}] 

...
var checkBox = Fancy.getWidget('married');

checkBox.set(true);

inputLabel

String

An optional text label that will appear next to the checkbox.


...
items: [{
  inputLabel: 'Remember me?',
  type: 'checkbox',
  width: 336,        
  name: 'remember',
  value: true
},{
...

label

String

Text of field.


...
items: [{
  label: 'Married',
  type: 'checkbox',
  name: 'married',
  value: true
},{
...

labelAlign

String

Align of label.

Values: right, left, top.


...
items: [{
  label: 'Married',
  type: 'checkbox',
  name: 'married',
  value: true,
  labelAlign: 'right'
},{
...
left

name

String

Name of field over which it is possible to get value of field.


...
items: [{
  label: 'Married',
  type: 'checkbox',
  name: 'married',
  value: true,
  labelAlign: 'right'
},{
...

type

String

Type of field (value - checkbox).


{
  label: 'Married',
  type: 'checkbox',
  name: 'married',
  value: true,
  labelAlign: 'right'
}

value

Boolean

Value 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();

get

():Boolean

return 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);

Events

change

(field, value)

Value of field.


items: [{
  label: 'Married',
  type: 'checkbox',
  name: 'married',
  value: true,
  events: [{
    change: function(){
      
    },
    scope: {}//not required
  }]
...