DataTable wont shot row from ajax sourced data
DataTable wont shot row from ajax sourced data
I have created a fiddle: http://live.datatables.net/xopuciga/1/edit
When I set this up, I had it working fine (returning the text 'TABLE')
(I am using ajax sourced data for the table in my live app but have changed it to a Javascript array in the fiddle to get a working)
I have added the ajax sourced child table via a callBack to formatTable but I keep getting an error.
I restored the ajax success call to call a function within the ajax call (instead of using the callBack) and the error still persists.
"TypeError: Cannot read property 'show' of undefined
It is telling me that the row I created is undefined now ... I don't understand what has changed.
I based this of the example here: https://datatables.net/examples/api/row_details.html
Answers
First you had quotes around the
dataSet
array making it a string. Removing the quotes makesdataSet
an array and the data populates. Ajax is an async process so theshow()
is executed before the ajax request completes. The Ajax loaded detail rows blog details how to do what you want.Kevin