Length Change Not Working with Bootstrap 3 and jQuery 1.7.2
Length Change Not Working with Bootstrap 3 and jQuery 1.7.2
Hello;
I've worked with DataTables many times in the past and love it so I thought I'd try to help here.
I was trying to figure out why my length change selections simply weren't being drawn. Here's the HTML I was getting:
<div class="row">
<div class="col-xs-6">
<div class="dataTables_length" id="genetic-profile-table_length">
<label></label>
</div>
</div>
<div class="col-xs-6">
<div id="genetic-profile-table_filter" class="dataTables_filter">
<label>Search:
<input type="search" class="form-control input-sm" aria-controls="genetic-profile-table">
</label>
</div>
</div>
</div>
I tried manually enabling with lengthChange
but no dice. There were no JavaScript errors and everything about DataTables functioned fine, except for there being no selection. This was happening in all browsers I tried.
On a hunch, I switched to a more recent jQuery version (1.11.1)
Everything worked! According to the docs, this shouldn't be the case:
jQuery 1.7 or newer will work with DataTables, although typically you will want to use the latest version.
Maybe it's just an issue with the Bootstrap stuff, but I'm not sure.
Just wanted to post something here in case someone else was having this issue or in case there was a bug that could be fixed.
Thanks!
Answers
Can you link to a test case showing the issue please?
Can you also check that you are using DataTables 1.10.1.
Allan
Hello allan;
Well, I hadn't pushed out the changes, yet. So I took a gander.
It appears I was using 1.10.0.
Changing to 1.10.1 fixes the issue.
I can confirm that jQuery 1.7.2 and 1.10.1, the selection is drawn fine. I can also confirm that jQuery 1.11.1 and DataTables 1.10.0 works fine.
However, jQuery 1.7.2 and 1.10.0 does not work.
You're welcome to check out one of the links on the site before I do a push this weekend if you're interested to see it in the wild:
https://www.smokereports.com/profile/david
If you don't get a chance to see it and you're still interested, I'd need to setup a quick test server to leave it at that revision as I plan on pushing out a lot of stuff this weekend.
Thanks for DataTables! You rock.
-randomdrake
That's for confirming that. Yes, there was a problem with 1.10.0 that is fixed in the latest release, so I think this issue can be closed.
Allan
I used DataTables 1.10 and jquery-1.11.1.min but it's not work, why?
@tenh - Please link to a test case showing the issue, as per the forum rules.
Allan