forked from verdnatura/hedera-web
29 lines
573 B
JavaScript
Executable File
29 lines
573 B
JavaScript
Executable File
Htk.ColumnCheck = new Class
|
|
({
|
|
Extends: Htk.Column
|
|
,Tag: 'htk-column-check'
|
|
|
|
,render: function (tr)
|
|
{
|
|
var checkButton = document.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 = this.parent (tr);
|
|
td.style.textAlign = 'center';
|
|
td.appendChild (checkButton);
|
|
return td;
|
|
}
|
|
|
|
,inputChanged: function (tr, node)
|
|
{
|
|
this.changed (tr, node.value);
|
|
}
|
|
});
|