Merge pull request #22127 from frederic34/select2multimatch

select2 multimatch
This commit is contained in:
Laurent Destailleur 2022-09-09 18:00:39 +02:00 committed by GitHub
commit e0bfd19262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 */