Topic: Multiselect with Option Groups
Adam Stapleton pro asked 6 years ago
Adam Stapleton pro answered 6 years ago
After some investigation into this, I have to say that I'm slightly disappointed by your initial response, I would go as far as to say that the query was answered with little/no knowledge of your own product.
As someone with very little JavaScript experience I managed to find a solution in a couple of hours. It eventually took changing only 2 lines of code to make the checkboxes appear for only the select options and not for the option groups.
For your information the required changes are:
Line 3028:
if (type === 'multiple' || type === 'optgroup-option') {
Line 30337:
if (type === 'multiple' || type === 'optgroup-option') {
Essentially you just treat an option group option as a multi select option and viola, problem solved.
Hopefully this is useful to someone else and maybe you can add it into the product at the next release cycle.
Mikołaj Smoleński staff answered 6 years ago
Adam Stapleton pro commented 6 years ago
That seems a strange decision to me. Would it not be just as easy to apply an additional class to the option groups within the select that hides the checkbox? A consistent user experience is one of the most valuable things from a developers point of view. Having different components of the same type act in different ways is a terrible solution.Mikołaj Smoleński staff commented 6 years ago
I will add Your remarks to our list of ideas and features. We'll discuss Your issue and try to improve the multiselect in one of the future releases. RegardsAdam Stapleton pro commented 6 years ago
Another solution to this would be to show the checkbox next to an option group name and just have clicking that option select all/none of the options within that option group. (That would probably be a useful feature for many of your customers).Mikołaj Smoleński staff commented 6 years ago
Thanks for Your remarksFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No