forked from verdnatura/hedera-web
32 lines
521 B
JavaScript
32 lines
521 B
JavaScript
|
Htk.Check = new Class
|
||
|
({
|
||
|
Extends: Htk.Field
|
||
|
,Tag: 'htk-check'
|
||
|
|
||
|
,initialize: function (props)
|
||
|
{
|
||
|
this.parent (props);
|
||
|
this.createElement ('input');
|
||
|
this.node.type = 'checkbox';
|
||
|
this.node.addEventListener ('change', this.changed.bind (this));
|
||
|
}
|
||
|
|
||
|
,changed: function ()
|
||
|
{
|
||
|
this.valueChanged (this.node.checked);
|
||
|
}
|
||
|
|
||
|
,putValue: function (value)
|
||
|
{
|
||
|
if (value)
|
||
|
this.node.checked = true;
|
||
|
else
|
||
|
this.node.checked = false;
|
||
|
}
|
||
|
|
||
|
,setEditable: function (editable)
|
||
|
{
|
||
|
this.node.disabled = !editable;
|
||
|
}
|
||
|
});
|