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 stringFormat = require('../core/string_format.js');
|
||||||
const MultiLineEditTextView = require('../core/multi_line_edit_text_view.js').MultiLineEditTextView;
|
const MultiLineEditTextView = require('../core/multi_line_edit_text_view.js').MultiLineEditTextView;
|
||||||
const Errors = require('../core/enig_error.js').Errors;
|
const Errors = require('../core/enig_error.js').Errors;
|
||||||
|
const { getPredefinedMCIValue } = require('../core/predefined_mci.js');
|
||||||
|
|
||||||
// deps
|
// deps
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
|
@ -423,4 +424,17 @@ exports.MenuModule = class MenuModule extends PluginModule {
|
||||||
++customMciId;
|
++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