Basic init causes dataTables_length & dataTables_filter to be in row & col-sm-6

Basic init causes dataTables_length & dataTables_filter to be in row & col-sm-6

CapamaniaCapamania Posts: 233Questions: 81Answers: 5
edited February 2017 in Free community support

I have a very basic and a advanced datatable running. In the basic one dataTables_length & dataTables_filter are each embedded in col-sm-6 what I don't want. What causes this effect and how to get rid of?

<div id="table01_wrapper class="dataTables_wrapper form-inline dt-bootstrap no-footer">
    <div class="row">
        <div class="col-sm-6">
            <div id="table01_length" class="dataTables_length"></div>
        </div>
        <div class="col-sm-6">
            <div id="table01_filter" class="dataTables_filter"></div>
        </div>
    </div>
</div>

With basic init:

$('#table01').dataTable();

But what I want is the setup like in the advance table this:

<div id="table02_wrapper class="dataTables_wrapper form-inline dt-bootstrap no-footer">
    <div id="table02_length" class="dataTables_length"></div>
    <div id="table02_filter" class="dataTables_filter"></div>
</div>

With advanced init:

$('#table01').dataTable({
    dom: "Blfrtip",
    buttons: [{...}]
    ajax: {...},
    columns: [{...}]
    serverSide: true,
    processing: true,
    ...
});

Many thanks

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    What causes this effect and how to get rid of?

    Your "basic init" code is not creating the HTML.
    Where is your HTML coming from? It seems to be using Bootstrap styling.

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Answer ✓

    In the basic one dataTables_length & dataTables_filter are each embedded in col-sm-6 what I don't want. What causes this effect and how to get rid of?

    You are probably seeing the default value that is used in the Bootstrap initialisation for the dom parameter. The dom documentation shows the default for the Bootstrap integration.

    Allan

  • CapamaniaCapamania Posts: 233Questions: 81Answers: 5

    Thanks Allan. With ... defining dom: 'Bflrtip', I'm back to my setup.

    Best Regards

This discussion has been closed.