itemFormat/focusItemFormat properties in Button
This commit is contained in:
parent
eb9d9055e9
commit
5f53ef9a60
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue