Datatables Multiples getJSON Request with Increment Dynamic

Datatables Multiples getJSON Request with Increment Dynamic

HeberPcLHeberPcL Posts: 2Questions: 1Answers: 0

Guys, I'm trying to make multiple requests from different sources of the same structure. The problem is how to do to increments the object allresults and update the Datatables.

I need Datatables not to expect all ajax callback, but to increase the results it receives.

In the example below I use .when to synchronize the results:
http://jsfiddle.net/HeberPcL/ws30xftd/

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @HeberPcL ,

    As you say, with ajax, it's expected that all the data is in the response. If you want to do increments, it would be worth looking at serverSide, since this is effectively what you're doing. You'll need to change your request/response to be compliant with the protocol, as detailed here.

    If you don't want to go down that route, the other option is to make all your ajax calls up front, collect the data into a single object, and refer to that single object when you initialise the table.

    Cheers,

    Colin

  • HeberPcLHeberPcL Posts: 2Questions: 1Answers: 0

    Colin, thank you for your response.

    I did the following, the first ajax request that is returned the datatables will be built with that response (partial). All other requests are added using "rows.add". It was an efficient solution for me, since I do not want to have this processing on the serverside.

    Thank you for your attention to my problem.

    :)

This discussion has been closed.