Sorting problem

Sorting problem

JovanJovan Posts: 16Questions: 0Answers: 0
edited September 2010 in General
Hi again, how to reset sorting after adding new row, so that is as default. I would like when I add row to be on top. I have hidden column (with ids from db) and sort on it as default.

Replies

  • cdaiglecdaigle Posts: 57Questions: 0Answers: 0
    I think what you might be looking for is the fnSort api function. (http://datatables.net/api#fnSort)
    After you add the row, you should be able to call
    [code]
    oTable.fnSort([[0, 'desc']]);
    [/code]
    Which will sort column 0 in descending order. (you can put your own column and order by)

    Hope this helps
This discussion has been closed.