0
1
Fork 0
hedera-web-mindshore/js/htk/field/check.js

32 lines
493 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
module.exports = new Class
({
Extends: Htk.Field
,Tag: 'htk-check'
2016-10-16 14:16:08 +00:00
,render: function ()
{
2016-10-16 14:16:08 +00:00
var node = this.createRoot ('input');
node.type = 'checkbox';
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;
}
});