Some fancy select fields need to be reloaded via ajax if other form values were changed. To do that, you can call requestLookup() method in joomla-field-fancy-select class (media/system/js/fields/joomla-field-fancy-select.js). But if select field has options before calling request method, new items will be added to old options, but in some cases all old options should be replaced.
The choices method choicesInstance.setChoices() is called inside requestLookup() with hardcoded flag "false" for parameter replaceChoices. Code:
if (items.length) {
this.choicesInstance.setChoices(items, 'value', 'text', false);
}
Is it possible to add aflag to the requestLookup() method, eg.:
requestLookup(replaceChoices) {
[...]
if (items.length) {
this.choicesInstance.setChoices(items, 'value', 'text', replaceChoices);
}
}
Thanks,
Daniel
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
?
|