forked from verdnatura/hedera-web
40 lines
618 B
JavaScript
Executable File
40 lines
618 B
JavaScript
Executable File
Htk.Entry = new Class
|
|
({
|
|
Extends: Htk.Field
|
|
,Tag: 'htk-entry'
|
|
|
|
,initialize: function (props)
|
|
{
|
|
this.createElement ('input');
|
|
this.node.type = 'text';
|
|
this.node.addEventListener ('change', this.onChange.bind (this));
|
|
|
|
this.parent (props);
|
|
}
|
|
|
|
,onChange: function (event)
|
|
{
|
|
var newValue;
|
|
|
|
if (this.node.value == '')
|
|
newValue = null;
|
|
else
|
|
newValue = this.node.value;
|
|
|
|
this.valueChanged (newValue);
|
|
}
|
|
|
|
,putValue: function (value)
|
|
{
|
|
if (!value)
|
|
this.node.value = '';
|
|
else
|
|
this.node.value = value;
|
|
}
|
|
|
|
,setEditable: function (editable)
|
|
{
|
|
this.node.readOnly = !editable;
|
|
}
|
|
});
|