Topic: Multiselect checkboxes
I am using the MultiSelect dropdown in MD5. The checkboxes are too far over to the left and I can't seem to move them in. I don't want to use CSS because if I use .select-option it will change the property for all dropdowns.
This is the code I am using in HTML
The dropdown is populated from an ajax call. How can I move the checkboxes more to the right within the dropdown. I cant seem to get a handle on the selector in jquery
thanks
Michał Duszak staff answered 4 years ago
You can do it programattically to apply those settings to certain dropdowns. As select
generates a dropdown which is not a select
's child, and only one dropdown can be opened at a time, I would suggest setting up an eventListener
for selected components.The selector for <option>
s is .select-options-list
, so you can grab each children and give them padding-left
to set the checkboxes to the right side.I gave the mySelect
class to selects I want to grab in order to edit the checkboxes position.
According to this snippethttps://mdbootstrap.com/snippets/standard/m-duszak/3023372#js-tab-view
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB jQuery
- MDB Version: 4.19.2
- Device: Laptop
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: No