If ordering is true what is the default order if no "order" option is specified

If ordering is true what is the default order if no "order" option is specified

kevins1966kevins1966 Posts: 7Questions: 5Answers: 0
edited January 22 in Free community support

Hello,

Before setting up my DataTable, I order the data in the default order I want.

With 'ordering: false' this data is displayed in that order however when this is set to true that order is ignored even though there is no 'order' option specified as discussed on the Default ordering (sorting) page of the website.

Anyone got any idea what might be controlling this or how I work it out?

For reference my table is initialised as follows

        ordering: false,
        orderCellsTop: true,
        deferRender: true,
        pageLength: 100,
        language: {
            paginate: {
                first: 'First',
                previous: 'Previous',
                next: 'Next',
                last: 'Last'
            }
        },
        layout: {
            topStart: 'pageLength',
            bottom: 'info',
            topEnd: 'paging',
            bottomStart: null,
            bottomEnd: null,
        },
        columnDefs: [
            {
                target: 'modelIdHide',
                visible: false,
                searchable: false
            }
        ],

Answers

  • allanallan Posts: 63,916Questions: 1Answers: 10,535 Site admin

    order is the parameter that controls the DataTable's load ordering state. As the docs note, the default is [[0, 'asc']] (i.e. ascending ordering on column index 0).

    Allan

Sign In or Register to comment.