? No Code Attached Yet
avatar dawe78
dawe78
20 Jan 2022

Is your feature request related to a problem? Please describe.

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.

Describe the solution you'd like

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

avatar dawe78 dawe78 - open - 20 Jan 2022
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Jan 2022
avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: ?
avatar Hackwar Hackwar - labeled - 17 Feb 2023

Add a Comment

Login with GitHub to post a comment