Wrong order rows

Wrong order rows

Adrian2007Adrian2007 Posts: 19Questions: 7Answers: 0

Hello,
Today I noticed another thing with DataTables: If I don't "enable" datatables for a table (i mean the table is raw, just html, like "

...

") the records order is correct, as they arrive from db. As soon as I "enable" datatables for the table (I mean var table = $('#tableList').dataTable({........) the order of the records changes in a wrong way,for example the first record becomes third, the second becomes fourth, ecc.

Is this a known issue or bug ? How can it be solved ?

Thankx,
Adrian2007

Answers

  • Adrian2007Adrian2007 Posts: 19Questions: 7Answers: 0

    sorry, I forgot to insert the quotes for the code....in the first line there should be "(i mean the table is raw, just html, like
    <table>...</table>

  • Adrian2007Adrian2007 Posts: 19Questions: 7Answers: 0

    I think the problem is "bSort": true . If I set this parameter to false the order of the rows is correct, as they arrive from db.

  • allanallan Posts: 63,791Questions: 1Answers: 10,513 Site admin

    Yes, if you leave ordering enabled (ordering) then DataTables will order the data using its built in sorting. Use ordering (or the legacy bSort option if you want to use the legacy options) to disable that behaviour.

    Allan

This discussion has been closed.