Add input "Search" to multiSelectArrayWithCheckbox() function
This commit is contained in:
parent
cd2df7caef
commit
7fa8fc343f
@ -8387,6 +8387,7 @@ class Form
|
|||||||
<dd class="dropdowndd">
|
<dd class="dropdowndd">
|
||||||
<div class="multiselectcheckbox'.$htmlname.'">
|
<div class="multiselectcheckbox'.$htmlname.'">
|
||||||
<ul class="ul'.$htmlname.' '.$htmlname.$pos.'">
|
<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.'
|
'.$listoffieldsforselection.'
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -8410,6 +8411,12 @@ class Form
|
|||||||
// Now, we submit page
|
// Now, we submit page
|
||||||
//$(this).parents(\'form:first\').submit();
|
//$(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
|
// Click onto the link "link to" or "hamburger", toggle dropdown
|
||||||
$(document).on(\'click\', \'.dropdown dt a\', function () {
|
$(document).on(\'click\', \'.dropdown dt a\', function () {
|
||||||
console.log("toggle dropdown dt a");
|
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\').slideToggle(\'fast\');
|
||||||
$(this).parent().parent().find(\'dd ul\').toggleClass("open");
|
$(this).parent().parent().find(\'dd ul\').toggleClass("open");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user