2016-09-26 09:28:47 +00:00
|
|
|
|
|
|
|
module.exports = new Class
|
2015-01-23 13:09:30 +00:00
|
|
|
({
|
|
|
|
Extends: Htk.Column
|
|
|
|
,Tag: 'htk-column-check'
|
|
|
|
|
2015-11-26 12:30:04 +00:00
|
|
|
,initialize: function (props)
|
|
|
|
{
|
|
|
|
this._cssClass = 'cell-check';
|
|
|
|
this.parent (props);
|
|
|
|
}
|
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
,render: function (tr)
|
|
|
|
{
|
2016-10-16 14:16:08 +00:00
|
|
|
var checkButton = this.createElement ('input');
|
2015-01-23 13:09:30 +00:00
|
|
|
checkButton.type = 'checkbox';
|
|
|
|
checkButton.checked = this.value;
|
|
|
|
|
|
|
|
if (this.editable)
|
|
|
|
checkButton.addEventListener ('changed',
|
|
|
|
this.inputChanged.bind (this, tr, node));
|
|
|
|
else
|
|
|
|
checkButton.disabled = true;
|
|
|
|
|
|
|
|
var td = this.parent (tr);
|
|
|
|
td.appendChild (checkButton);
|
|
|
|
return td;
|
|
|
|
}
|
|
|
|
|
|
|
|
,inputChanged: function (tr, node)
|
|
|
|
{
|
|
|
|
this.changed (tr, node.value);
|
|
|
|
}
|
|
|
|
});
|