select2 multimatch

This commit is contained in:
Frédéric FRANCE 2022-09-07 18:38:00 +02:00
parent 46925dc9c4
commit 8a742df8de

View File

@ -455,6 +455,18 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
width: \''.$widthTypeOfAutocomplete.'\', /* off or resolve */ width: \''.$widthTypeOfAutocomplete.'\', /* off or resolve */
minimumInputLength: '.$minLengthToAutocomplete.', minimumInputLength: '.$minLengthToAutocomplete.',
language: select2arrayoflanguage, language: select2arrayoflanguage,
matcher: function (params, data) {
if ($.trim(params.term) === "") {
return data;
}
keywords = (params.term).split(" ");
for (var i = 0; i < keywords.length; i++) {
if (((data.text).toUpperCase()).indexOf((keywords[i]).toUpperCase()) == -1) {
return null;
}
}
return data;
},
containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
selectionCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ selectionCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
templateResult: function (data, container) { /* Format visible output into combo list */ templateResult: function (data, container) { /* Format visible output into combo list */