Can fnAddData(['element1', 'element2'], false) add to top of table?

Can fnAddData(['element1', 'element2'], false) add to top of table?

jeffwjeffw Posts: 38Questions: 5Answers: 0
edited January 2014 in General
This will insert row according to default sort:
oTable.fnAddData([ "My Company" , "ABC", "01/28/2014"]);

This will insert row at end, ignoring default sort:
oTable.fnAddData([ "My Company" , "ABC", "01/28/2014"], false);

Anyone know a way to insert a row without sorting (as in second example) but have it add to the *top* instead of end? This would make it less cumbersome on long lists to find the newly added row.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Ordering of the rows in a DataTable is done entirely but the sort condition applied to the table. If you want a specific row to show up in a specific place, the sorting criteria applied to the table must put it there.

    Perhaps one option is to add a highlight class to the newly added row for a short amount of time?

    Allan
This discussion has been closed.