dom to layout conversion - dt 1.13.8 -> 2.1.4

dom to layout conversion - dt 1.13.8 -> 2.1.4

mihomesmihomes Posts: 160Questions: 22Answers: 0

Not sure if this is even possible to convert from what I am seeing in the docs. I see the dom option is going to be removed soon so time to see if anything can be done. As you can see I have some custom divs with classes and inserting options into them. I played around with the new layout, but it doesn't seem like it offers nearly as much customization as the soon to be deprecated dom - not to mention it auto creates its own layout for everything.

Is this even possible to recreate? If not, is there a way I can insert the page info and pagination manually with js on each draw (I am using server side)? I have a feeling this is going to be a ton of work for me if I want to keep using the latest datatables versions as I have a pretty extensive site and lots of customization going on.

            var dt = dataTable.DataTable({
        "dom":
            "r"+
            "<'dtTable table-responsive't>"+
            "<'dtFooter'ip>",
                "next option"

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,978Questions: 1Answers: 10,363 Site admin
    Answer ✓

    As of 2.1 yes, this is possible with the ability to specify class names and ids for the layout grid.

    This example will hopefully be of some help.

    For the table-responsive div, you'll need to do:

    DataTable.ext.classes.layout.tableCell = 'table-responsive';
    

    The table is no longer positioned by layout (at least not quite the way that dom did it), hence the need for that line.

    Allan

  • mihomesmihomes Posts: 160Questions: 22Answers: 0

    Okay, the tableCell part is what was giving me trouble. I got it figured out now. Thanks.

Sign In or Register to comment.