Type detection in fnAddData/fnUpdate

Type detection in fnAddData/fnUpdate

cobbwebcobbweb Posts: 1Questions: 0Answers: 0
edited May 2011 in Bug reports
In my column definitions I provide custom rendering callbacks (via fnRender property). I want to pass an object as my data and use my fnRender functions to convert to a string.

However, DataTables uses typeof mData == "object" to detect for arrays which is wrong as it will also be true for plain objects {var: "value"}.

Solution: Use jQuery's $.isArray(mData) instead.

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Have a look at the 1.8 beta :-) It allows passing of abstract objects and to use them as you wish. This blog post might be of interest as well: http://datatables.net/blog/Extended_data_source_options_with_DataTables

    Allan
This discussion has been closed.