Merge remote-tracking branch 'refs/remotes/origin/support/3.1' into support/3.2

# Conflicts:
#	.make/composer/rmDeniedTestDir.php
#	application/utils.inc.php
This commit is contained in:
jf-cbd
2024-05-17 11:16:56 +02:00
4 changed files with 56 additions and 54 deletions

View File

@@ -4,6 +4,7 @@
{# SET WIDGET #}
{% set oDataProvider = oUIBlock.GetDataProvider() %}
let optionsBeforeFilter;
let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
{# Global options #}
@@ -117,6 +118,7 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
// Filter old options data to keep selected values
// (options with force flag will be kept event if they doesn't be part of the current value)
let options = Object.values(me.options);
optionsBeforeFilter = options;
options = options.filter(item => (typeof(item.force) !== "undefined" && item.force === true) || aSelectedItems.includes(item['{{ oDataProvider.GetDataValueField() }}']));
// Merge kept and new values
options = $.merge(options, res.data.search_data);
@@ -235,6 +237,11 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
{% endif %}
},
onBlur: function(){
this.clearOptionGroups()
this.addOption(optionsBeforeFilter)
},
{# plugin combodo_add_button #}
{% if oUIBlock.HasAddOptionButton() and oUIBlock.HasAddOptionButtonJsOnClick() %}
onAdd: function(){