Topic: MDB Pro v4 glitches with Jquery Datatables
joshusre pro asked 7 years ago
Hi,
I'm using jquery datatables in a project with my mdb templates and I'm having trouble. The material select drop down prevent the default datatable drop downs from showing and when you add mdb-select to try and fix (including initializing it) you get a mdb drop down but its buggy (stays open after selecting an option).
Is there a possibility that this will be fixed?
Alternatively, is there a way to keep MDB from adjusting my select objects?
Thanks for your help.
vgaire007 free answered 6 years ago
$(document).ready(function () { $('.select-dropdown').remove(); $('.caret').remove(); $('select[name="datatables_length"]').addClass('browser-default'); });
Jakub Strebeyko staff commented 6 years ago
Hi, Removing the.select-dropdown
is one way to do it, for sure. All suggestions are welcome!
With Best Regards,
Kuba
ramix priority answered 6 years ago
Jakub Strebeyko staff commented 6 years ago
Hi, which example do you mean?QiTEC pro commented 6 years ago
https://mdbootstrap.com/previews/templates/admin-dashboard/html/tables/datatables.htmlQiTEC pro commented 6 years ago
This worked for me: // Bugfix for re-opening of pagelength-dropdown $('.dataTables_length select').change(function () { $(this).material_select('destroy'); $(this).unbind('click').click(function () { $(this).material_select(); }); });Jakub Strebeyko staff commented 6 years ago
Thanks for taking time and sharing the hotfix! Surely it will help people out there.Jakub Strebeyko staff answered 6 years ago
Hi there everyone!
I have good news - couple of them, actually. First of, the material select
has been improved and so it should cause trouble in data-tables no more. Please update your package to the newest version (4.4.5) for it to reflect the recent developments. That's not all; we actually went further and decided to lean towards flexible development and custom packaging of MDB-based projects. It means that now you can hand-pick MDB utilities that you really need, leaving out the rest, greatly reducing package size. Please refer to out offcial Bootstrap Gulp tutorial. This should be especially helpful when your local environment and/or tools conflict with their MDB counterparts, as seemed to be the case here.
With Best Regards,
Kuba
Jakub Strebeyko staff answered 7 years ago
joshusre pro commented 7 years ago
I always wondered if buying this template was a poor choice on my part. This kind of stuff re-enforces my opinion that it was.Jakub Strebeyko staff commented 7 years ago
I am sorry to hear that. We will do our best to "de-inforce" it back, though, so be sure to check out our updates. Cheers!FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Bartłomiej Malanowski staff commented 7 years ago
Please show us live demojoshusre pro commented 7 years ago
Are mdb.css / mdb.js accessible via CDN? Or, is there a third party site you know of that would let me upload mdb.css / js and allow me to fulfill your request? Would GIF suffice?Bartłomiej Malanowski staff commented 7 years ago
yes, MDB Free is available via CDN: https://cdnjs.com/libraries/mdbootstrapjoshusre pro commented 7 years ago
I'll have this posted soon. Thank you for your patience.Shane West free commented 7 years ago
Has anyone found a fix for this? If you still need a demo this happens in Chrome (56.0.2924.87) on your demo page: https://mdbootstrap.com/content/tables/#sorting Here's a gif of the behavior: https://imgur.com/CeWSvtphello@canberranet.com.au pro commented 7 years ago
it happens to your demo page: https://mdbootstrap.com/content/tables/#sorting After clicking an entry in the show entries drop down, the dropdown closes, but then opens again. I too would like a fix for this.