hedera-web/js/htk/columns/check/index.js

32 lines
699 B
JavaScript
Raw Normal View History

2022-06-06 16:02:17 +00:00
require('./style.scss');
2022-06-06 08:53:59 +00:00
module.exports = new Class({
Extends: Htk.Column
,Tag: 'htk-column-check'
,initialize: function(props) {
this._cssClass = 'cell-check';
2022-06-06 16:02:17 +00:00
Htk.Column.prototype.initialize.call(this, props);
2022-06-06 08:53:59 +00:00
}
,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;
2022-06-06 16:02:17 +00:00
var td = Htk.Column.prototype.render.call(this, tr);
2022-06-06 08:53:59 +00:00
td.appendChild(checkButton);
return td;
}
,inputChanged: function(tr, node) {
this.changed(tr, node.value);
}
});