can sAjaxSource return column definitions?

can sAjaxSource return column definitions?

lancehilliardlancehilliard Posts: 4Questions: 0Answers: 0
edited October 2013 in DataTables 1.9
Can the endpoint specified in sAjaxSource return, in addition to aaData, a property which defines the columns (similar to aoColumns)?

Replies

  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Currently no. The reason for that is that JSON cannot include functions, which although not needed in aoColumns can be defined ( mRender etc) So currently, if you want to Ajax load column definitions, you need to use $.ajax to get the information. This might be relaxed in future versions of DataTables, but not yet!

    Regards,
    Allan
  • lancehilliardlancehilliard Posts: 4Questions: 0Answers: 0
    edited October 2013
    I'm using mRender functions in my column definitions. I tried $.ajax before your reply, and sure enough it failed, b/c (as you said) the JSON including functions won't parse[1].

    [1] http://stackoverflow.com/a/2001471/116895
This discussion has been closed.