Using Bootstrap 2 and bLengthChange=false

Using Bootstrap 2 and bLengthChange=false

cgarveycgarvey Posts: 1Questions: 0Answers: 0
edited April 2012 in DataTables 1.9
Hi!

I'm using version 1.9.1 and Bootstrap 2.0.3. All going well except when I disable the select/drop-down for records per page using...
[code]"bLengthChange":false[/code]

That does what I expect it to, but it generates an empty ...
[code][/code]
... for the left hand side (and the search box goes in to the right hand column of that grid row). Again, all makes sense. However, that empty column on the left means that Bootstrap styling doesn't render it as expected. The right-hand column (with search box) is now in the middle of the page, as though it was the first column. Bootstrap seems to be ignoring the empty column.

Ideally, we'd add a   inserted in that empty , which causes Bootstrap to render the full width (6 grid cols) as expected. As a short term hack, I've added an additional CSS class to the "sDom" attribute, and use jQ to include a   in there, as follows:[code]
$(document).ready(function() {
$('#tblTRN').dataTable( {
"sDom": "<'row'<'span6 dtForceSpace'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"bLengthChange": false,
} );
$(".dtForceSpace" ).html( $(".dtForceSpace" ).html() + " " );
} );
[/code]

So, am I missing some additional argument, or is this a simple issue that can be resolved?

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Why not just alter the DIV described in sDom for the filtering input to be span12 and have it take up the full space available?

    Allan
This discussion has been closed.