diff --git a/core/button_view.js b/core/button_view.js index 31fb7dc3..bc9e70cf 100644 --- a/core/button_view.js +++ b/core/button_view.js @@ -5,6 +5,9 @@ const TextView = require('./text_view.js').TextView; const miscUtil = require('./misc_util.js'); const util = require('util'); +// deps +const { isString } = require('lodash'); + exports.ButtonView = ButtonView; function ButtonView(options) { @@ -33,3 +36,18 @@ ButtonView.prototype.onKeyPress = function (ch, key) { ButtonView.prototype.getData = function () { 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); +};