Guide for switching from array as data source to objects

Guide for switching from array as data source to objects

toomanyloginstoomanylogins Posts: 28Questions: 9Answers: 0
edited June 4 in DataTables 2

All of my DT tables use arrays as the data source. However, moving forward, it would make sense to start migrating to using objects, particularly if we're going to use the editor. Is there Guide or tutorial available which describes the process, changes that need to be made on the client side. These are all serverside tables.
Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 64,519Questions: 1Answers: 10,664 Site admin
    Answer ✓

    This would be your best source of information. Basically it is simply a case of defining columns.data to be the key in the object that you want for that column. It is also helpful to know that columns.data, if not defined, will default to the column index - which is how the arrays work and are read!

    Allan

  • toomanyloginstoomanylogins Posts: 28Questions: 9Answers: 0
    edited June 4

    Thanks, turned out to be quite straight forward.
    Replaced target[] with data: 'fieldname' and columnsDefs with columns that was it.

Sign In or Register to comment.