Appending Data

Appending Data

DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0

The documentation does not seem extensive enough to answer the question I have.

Currently I have 2 ajax calls that drop the JSONs into two global arrays and I use concat.apply to merge the two into 1 json object which is loaded by datatables.

Reason I do this is because the JSON files are huge, too huge and without serverside-processing, the only way to deliver 30 MB JSON files to IE9 without having it crash is to split it into two calls.

Anyways,

The concate function itself is crashing IE now since DOM manipulation is very costly in IE. Especially considering initialization by datatables for a JSON object that has over a million cells crashes IE completely (Except of course when I load it as a local file, go figure)

Anyways I wanted to know if I could simply have datatables initialize with one of these global variables (Which i know it can since im doing it right now) but ALSO after its initialized and loaded, I want it append the other JSON object from the other call. This way IE does not have to concatenate anything.

do I simply call http://datatables.net/examples/api/add_row.html after all my initialization functions?

How do I have it use with my global variable?

Answers

  • DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0

    What is the syntax here?

    table.rows.add("data":jsonBot).draw();

    jsonBot is my JSON object. returns as [ object, object, object ]

  • DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0

    Figured it out. Wow that was simple. I just wasnt nesting my functions properly.

    table.rows.add(jsonBot).draw();
    
This discussion has been closed.