How to add new in top of the position - using row.add() api method

How to add new in top of the position - using row.add() api method

sivaramakannansivaramakannan Posts: 1Questions: 1Answers: 0

table.row.add( {
"col1": "Tiger Nixon",
"col2": "$3,120",
"col3": "2011/04/25",
"col4": "Edinburgh",
"col5": "5421"
} ).draw();

I have used above code. But It appers in bottom of the table. How to solve that ???

Answers

  • allanallan Posts: 61,805Questions: 1Answers: 10,118 Site admin

    The position of the newly added row in the table is entirely defined by the ordering criteria applied to the table. If you want a row to appear at the top, you need to use ordering (sorting) to put it at the top.

    Allan

This discussion has been closed.