Etemplate: add get/set_value() to valueWidget interface

This commit is contained in:
nathangray 2021-05-19 11:14:52 -06:00
parent 8ec590a068
commit 94f5c437e8
2 changed files with 27 additions and 0 deletions

View File

@ -114,6 +114,17 @@ var et2_valueWidget = /** @class */ (function (_super) {
// Copy the given value // Copy the given value
this.label = _value; this.label = _value;
}; };
et2_valueWidget.prototype.get_value = function () {
return this.value;
};
/**
* Set value of widget
*
* @param {string} _value value to set
*/
et2_valueWidget.prototype.set_value = function (_value) {
this.value = _value;
};
et2_valueWidget._attributes = { et2_valueWidget._attributes = {
"label": { "label": {
"name": "Label", "name": "Label",

View File

@ -44,6 +44,7 @@ export class et2_valueWidget extends et2_baseWidget
}; };
label: string = ''; label: string = '';
value: string|number|Object;
protected _labelContainer: JQuery = null; protected _labelContainer: JQuery = null;
/** /**
@ -143,5 +144,20 @@ export class et2_valueWidget extends et2_baseWidget
// Copy the given value // Copy the given value
this.label = _value; this.label = _value;
} }
get_value()
{
return this.value;
}
/**
* Set value of widget
*
* @param {string} _value value to set
*/
set_value(_value : any | null)
{
this.value = _value;
}
} }