Data lazy loading in DataTables 1.9

Data lazy loading in DataTables 1.9

yzhang1121yzhang1121 Posts: 5Questions: 0Answers: 0
edited December 2013 in DataTables 1.9
Hi, Allen,

I saw your answer to an old discussion about lazy loading. You referred to this page: http://datatables.net/examples/server_side/pipeline.html. I copied the code to my file. It worked well. But I got an error:

TypeError: json.aaData is undefined

json.aaData.splice(0, iRequestStart - oCache.iCacheLower);

What do I miss something here? I am using Datatables 1.9.

Thank you for your help,

Yin

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Please link to a test case showing the problem. I'm afraid I don't know what would cause that issue without guessing based on the limited information available. My best guess is that the JSON return doesn't have an aaData property, like the error says.

    Allan
  • yzhang1121yzhang1121 Posts: 5Questions: 0Answers: 0
    Allan,
    Sorry for the delay. I looked into your code. If bNeedServer is true, my report is ok. No errors. But if bNeedServer is not true, the code goes to this branch:

    json = jQuery.extend(true, {}, oCache.lastJson);
    //console.log(oCache.lastJson);
    json.sEcho = sEcho; /* Update the echo for each response */
    json.aaData.splice(0, iRequestStart - oCache.iCacheLower);
    json.aaData.splice(iRequestLength, json.aaData.length);
    fnCallback(json);
    return;

    console.log(oCache.lastJson) returned undefined. What should I modify here?

    Thanks,

    Yin
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Not sure I'm afraid. I'd need to see a test case to understand what is going wrong.

    Allan
This discussion has been closed.