fnGetNodes() with AJAX

fnGetNodes() with AJAX

loadbrainloadbrain Posts: 18Questions: 0Answers: 0
edited July 2009 in General
Hello,
I am filling my table with an AJAX call, everything is fine so far.
Now I want to get all the nodes with[code]fnGetNodes()[/code].
But this returns me only the template of my html file of the table not the dynamic built table.

How is this able???

Replies

  • loadbrainloadbrain Posts: 18Questions: 0Answers: 0
    Ok, I found a solution:
    Using fnInitComplete and then I have access to all the data.

    Great thing, DataTables, I love it!
  • allanallan Posts: 62,448Questions: 1Answers: 10,251 Site admin
    Hi loadbrain,

    Good stuff - glad to hear you got it sorted. What was happeing was that the Ajax call that DataTables makes to load the data is asynchronous - this means that the main thread of the Javascript will continue to execute, and hence you get the empty nodes array (because the data has not yet loaded!). So you are bob on - fnInitComplete is the way to do it :-)

    Regards,
    Allan
This discussion has been closed.