Ajax with rows()?
Ajax with rows()?

I've been trying to get child rows working for a bit now and finally figured out the problem, in my working code example where I provide data it works fine but when I switch over to my own test environment where the data comes in from Ajax the child rows don't appear because .rows() doesn't appear to be available to Ajax.
Here's the working jsbin example without Ajax
http://live.datatables.net/wexisume/4/edit?js,output
And the same code with Ajax appears in my app
"ajax": {
"url": "/admin/users/data/"
},
Instead of:
"data": testdata.data,
So it's receiving the data from Ajax just fine but the .rows() isn't available so I need to come up with another way to add the child rows for each entry. (The code can be seen in the JS Bin link above)
This question has an accepted answers - jump to answer
Answers
Ajax is an async operation. The
rows().every()
function is executed before the table is loaded. Try moving that code insideinitComplete
. Here is an example I adapted to show this:http://live.datatables.net/gohefoki/13/edit
Kevin
That worked perfectly kthorngren, thank you so much!