Skip to content

Unable to change behavior of layout #375

@mapsedge

Description

@mapsedge

Datatables v2.3.7

I have tried every variation I can think of to change the order that things happen in the top, topstart, and topend sections, and nothing changes: it's always the defaults - I think. Currently the code looks like this:

DataTable.defaults.layout = {
    top: null,
    topStart: null,
    topEnd: null,
    bottomStart: null,
    bottomEnd: null,
    bottom: null
};
gTable = new DataTable('#tblBigList', {
    data: JSON.parse(jretval.data),
    pageLength: 10,
    order: [[0, 'asc']], // Sort by part number by default
    responsive: true,
    lengthMenu: [[10, 15, 25, 50, 100, -1], [10, 15, 25, 50, 100, "All"]],
    layout: {
        top: ['paging', 'pageLength', 'info'] // just for testing
    }
    , searching: false
    , initComplete: function () {
...

...but the order is still pageLength, info, and paging. What I'm trying to accomplish is

pageLength ... info ... pages->number = 4

I've copied/pasted the code on the website exactly, and I can't make anything change, let alone adding options to the option, i.e.

layout: {
    top: [
        pageLength: {},
        info: {},
        paging: {
            numbers: 4
        }
    ]
}

What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions