mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 17:13:03 +01:00
Add input "Search" to multiSelectArrayWithCheckbox() function
This commit is contained in:
@@ -8387,6 +8387,7 @@ class Form
|
||||
<dd class="dropdowndd">
|
||||
<div class="multiselectcheckbox'.$htmlname.'">
|
||||
<ul class="ul'.$htmlname.' '.$htmlname.$pos.'">
|
||||
<li><input class="inputsearch_dropdownselectedfields width90p minwidth200" style="width:90%;" type="text" placeholder="'.dol_escape_js($langs->trans('Search')).'"></li>
|
||||
'.$listoffieldsforselection.'
|
||||
</ul>
|
||||
</div>
|
||||
@@ -8410,6 +8411,12 @@ class Form
|
||||
// Now, we submit page
|
||||
//$(this).parents(\'form:first\').submit();
|
||||
});
|
||||
$("input.inputsearch_dropdownselectedfields").on("keyup", function() {
|
||||
var value = $(this).val().toLowerCase();
|
||||
$(\'.multiselectcheckbox'.$htmlname.' li > label\').filter(function() {
|
||||
$(this).parent().toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -108,6 +108,7 @@ if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) {
|
||||
// Click onto the link "link to" or "hamburger", toggle dropdown
|
||||
$(document).on(\'click\', \'.dropdown dt a\', function () {
|
||||
console.log("toggle dropdown dt a");
|
||||
setTimeout(() => { $(\'.inputsearch_dropdownselectedfields\').focus(); }, 200);
|
||||
|
||||
//$(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\');
|
||||
$(this).parent().parent().find(\'dd ul\').toggleClass("open");
|
||||
|
||||
Reference in New Issue
Block a user