itemFormat/focusItemFormat properties in Button

This commit is contained in:
Bryan Ashby 2023-02-01 22:00:31 -07:00
parent eb9d9055e9
commit 5f53ef9a60
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
1 changed files with 18 additions and 0 deletions

View File

@ -5,6 +5,9 @@ const TextView = require('./text_view.js').TextView;
const miscUtil = require('./misc_util.js'); const miscUtil = require('./misc_util.js');
const util = require('util'); const util = require('util');
// deps
const { isString } = require('lodash');
exports.ButtonView = ButtonView; exports.ButtonView = ButtonView;
function ButtonView(options) { function ButtonView(options) {
@ -33,3 +36,18 @@ ButtonView.prototype.onKeyPress = function (ch, key) {
ButtonView.prototype.getData = function () { ButtonView.prototype.getData = function () {
return this.submitData || null; return this.submitData || null;
}; };
ButtonView.prototype.setPropertyValue = function (propName, value) {
switch (propName) {
case 'itemFormat':
case 'focusItemFormat':
if (isString(value)) {
this[propName] = value;
}
break;
default:
break;
}
ButtonView.super_.prototype.setPropertyValue.call(this, propName, value);
};