Multiselect not working


Topic: Multiselect not working

dmpneuro pro premium asked 6 years ago

Your multiselect is not working properly (checkboxes gone and button doesn't show properly), and you provided and answer to another user about how to update material-select.js. You said to swap out code at lines 160/171. My editor (visual studio code) doesn't have similar code at those lines. Other lines have similar ('options.append ...') code, but I don't know which of those lines to switch. Can you be more specific about which code I have to switch (not just line numbers)?

Marta Szymanska staff pro premium answered 6 years ago

Hi, update your package to the newest version of MDB - 4.5.8. We updated and fixed the multiselect in this version. If anything still won't work, please write to us. Best, Marta

logiczone commented 6 years ago

Does your website use 4.5.8? Looks like "Multiselect with icons", "Multiselect with search box", "Multiselect with label and search box", "Colorful Multiselect with label and search box", "Multiselect with options groups and search box", "Multiselect with icons and search box" are all not working. All I see is a blue Save button. https://mdbootstrap.com/javascript/bootstrap-multiselect/

Piotr Glejzer staff answered 6 years ago

We are very sorry but we have a bug in material select. We have a fix for you! We will fix it globally in next release. This fix is easy and fast.

You need to find your material-selecjt.js file.
Next, you need to go to 160 line in material select.
Change icon_url to iconUrl !

It should look like that :


if (iconUrl) {

 var classString = '';
 if (classes) {

 classString = ' class="' + classes + '"';
 }

 if (type === 'multiple') {

 options.append($('<li class="' + disabledClass + '"><img alt="" src="' + iconUrl + '"' + classString + '><span class="filtrable"><input class="form-check-input" type="checkbox"' + disabledClass + '/><label></label>' + option.html() + '</span></li>'));
 } else {

 options.append($('<li class="' + disabledClass + optgroupClass + '"><img alt="" src="' + iconUrl + '"' + classString + '><span class="filtrable">' + option.html() + '</span></li>'));
 }

We are very sorry again about that bug.

Best,
Piotr


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No