Adding rows with ColReorder

Adding rows with ColReorder

peterkronenbergpeterkronenberg Posts: 112Questions: 0Answers: 0
edited November 2010 in General
When adding a row using fnAddData or fnAddDataAndDisplay, does the data have to be in the order that is currently displayed (i.e., if column order has been changed using ColReorder), or can the data be in the original order?

Replies

  • allanallan Posts: 63,508Questions: 1Answers: 10,471 Site admin
    It needs to be in the current order. DataTables will actually reorganise it's internal data structure when reordering the column (or rather, the ColReorder plug-in does it on its behalf). There is an internal function called _fnReOrderIndex which may be of some use (even just to rip out the code) which uses the sName parameter from the columns to do reordering with server-side processing. This might be a suitable plug-in in future...

    Allan
  • peterkronenbergpeterkronenberg Posts: 112Questions: 0Answers: 0
    Will fnSettings().aoColumns.nTh be in the current order?
  • allanallan Posts: 63,508Questions: 1Answers: 10,471 Site admin
    Yes - all DataTables internal data stores will be in the current order, including aoColumns and aoData properties.

    Allan
This discussion has been closed.