Twitter Bootstrap pagination incompatibility with Row Grouping Plugin

Twitter Bootstrap pagination incompatibility with Row Grouping Plugin

dobakadobaka Posts: 4Questions: 0Answers: 0
edited April 2012 in Plug-ins
I've successfully applied Twitter-bootstrap to my plain tables but encountered error on tables initialised with Row-grouping plugin.


The error

[code]DataTables warning (table id = 'example'): Cannot reinitialise DataTable.

To retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy[/code]

I find out that repagination seems to cause the error and removing DT-bootstrap.js corrected the issue, however the pagination will not be in bootstrap formatting. Not a big issue but will appreciate any help in uniforming the looks of the tables.



Thanks.

Replies

  • dobakadobaka Posts: 4Questions: 0Answers: 0
    edited April 2012
    And 10 minutes later, I managed to solve it.

    Put your js at the bottom of your page
    eg

    [code]



    $(document).ready( function () {
    $('#example').dataTable().rowGrouping({ iGroupingColumnIndex2: 1,
    sGroupLabelPrefix: "Category - ",
    sGroupLabelPrefix2: "Group - ",
    bHideGroupingColumn2: true,
    bExpandableGrouping: false,
    bExpandSingleGroup: true,
    iExpandGroupOffset: -1,
    sPaginationType: "bootstrap"});

    } );




    [/code]

    Seriously, I will definitely donate to the developers ASAP. Datatables rock.
This discussion has been closed.