[Resolved] How to use mData and aTargets
[Resolved] How to use mData and aTargets
I am new to DataTables. While I got the simple Ajax example to work (where the JSON file contains just "aaData" and array of multidimensional arrays), I wanted to use mData to set up a more complicated JSON.
Here is the remote URL:
http://stephentang.info/files/index.html
Here is the debug information:
http://debug.datatables.net/ezevol
My HTML table has 6 columns, my dataTables innitialization has 6 mData objects, and my JSON has what I think the server is expecting from this documentation: http://datatables.net/release-datatables/examples/server_side/object_data.html
I'm getting a "Cannot read property 'length' of undefined" in the console. The debugger shows no row data.
Any help would be appreciated.
EDIT: It appears that the aTargets prop has to be used in my case, but I'm confused as to why I would need it in this situation.
Here is the remote URL:
http://stephentang.info/files/index.html
Here is the debug information:
http://debug.datatables.net/ezevol
My HTML table has 6 columns, my dataTables innitialization has 6 mData objects, and my JSON has what I think the server is expecting from this documentation: http://datatables.net/release-datatables/examples/server_side/object_data.html
I'm getting a "Cannot read property 'length' of undefined" in the console. The debugger shows no row data.
Any help would be appreciated.
EDIT: It appears that the aTargets prop has to be used in my case, but I'm confused as to why I would need it in this situation.
This discussion has been closed.
Replies
See: http://datatables.net/usage/columns
Allan
Thanks for clarifying. I saw aTargets mentioned in the aoColumnDefs definition, but I didn't realize it was mandatory. I had thought the code would auto-detect based on the existing mData objects.