32 lines
699 B
JavaScript
32 lines
699 B
JavaScript
require('./style.scss');
|
|
|
|
module.exports = new Class({
|
|
Extends: Htk.Column
|
|
,Tag: 'htk-column-check'
|
|
|
|
,initialize: function(props) {
|
|
this._cssClass = 'cell-check';
|
|
Htk.Column.prototype.initialize.call(this, props);
|
|
}
|
|
|
|
,render: function(tr) {
|
|
var checkButton = this.createElement('input');
|
|
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 = Htk.Column.prototype.render.call(this, tr);
|
|
td.appendChild(checkButton);
|
|
return td;
|
|
}
|
|
|
|
,inputChanged: function(tr, node) {
|
|
this.changed(tr, node.value);
|
|
}
|
|
});
|