Add refreshPredefinedMciViewsByCode()
This commit is contained in:
parent
d244cd25fa
commit
783f142e20
|
@ -10,6 +10,7 @@ const Config = require('./config.js').config;
|
|||
const stringFormat = require('../core/string_format.js');
|
||||
const MultiLineEditTextView = require('../core/multi_line_edit_text_view.js').MultiLineEditTextView;
|
||||
const Errors = require('../core/enig_error.js').Errors;
|
||||
const { getPredefinedMCIValue } = require('../core/predefined_mci.js');
|
||||
|
||||
// deps
|
||||
const async = require('async');
|
||||
|
@ -423,4 +424,17 @@ exports.MenuModule = class MenuModule extends PluginModule {
|
|||
++customMciId;
|
||||
}
|
||||
}
|
||||
|
||||
refreshPredefinedMciViewsByCode(formName, mciCodes) {
|
||||
const form = _.get(this, [ 'viewControllers', formName] );
|
||||
if(form) {
|
||||
form.getViewsByMciCode(mciCodes).forEach(v => {
|
||||
if(!v.setText) {
|
||||
return;
|
||||
}
|
||||
|
||||
v.setText(getPredefinedMCIValue(this.client, v.mciCode));
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue