Howdy:
I have sAjaxSource and sAjaxDataProp set like:
...so that my Datatable implementation uses the 'assignments' collection for its row data.
This works fine if there are values in the assignments collection. However, the REST server I'm connecting to sends back assignments as null if there are no rows available, e.g.:
And I get the following error from Datatables:
Obviously it's not happy having a null property while trying to drill down to the data. Is there any way to null check the response before handing off to Datatables?
I was actually able to get past this same problem on another project by creating a Backbone collection for the data source and then using the Backbone parse method to null check and provide an empty collection to Datatables... but I'd like to know if there's a way around it without going that far.
I love Datatables. Thanks!
NBB (Dallas, Texas)
I have sAjaxSource and sAjaxDataProp set like:
"sAjaxSource": "/rest/roles.json", "sAjaxDataProp": "roles.assignments"
...so that my Datatable implementation uses the 'assignments' collection for its row data.
This works fine if there are values in the assignments collection. However, the REST server I'm connecting to sends back assignments as null if there are no rows available, e.g.:
{ "roles" : null }
And I get the following error from Datatables:
TypeError: aData is undefined
Obviously it's not happy having a null property while trying to drill down to the data. Is there any way to null check the response before handing off to Datatables?
I was actually able to get past this same problem on another project by creating a Backbone collection for the data source and then using the Backbone parse method to null check and provide an empty collection to Datatables... but I'd like to know if there's a way around it without going that far.
I love Datatables. Thanks!
NBB (Dallas, Texas)