How to send 2 ajax json files ?

How to send 2 ajax json files ?

islamelshobokshyislamelshobokshy Posts: 99Questions: 20Answers: 1

I want to send 2 ajax json files to datatables, one to be used to the body, and one for the footer in the FooterCallback. How can I do so?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @islamelshobokshy ,

    For the body, you would let DataTables do the Ajax legwork, as in the examples in this section here.

    For the footer, you would just make a handcrafted Ajax request in the footerCallback, then parse and load that data yourself.

    Hope that helps,

    Cheers,

    Colin

  • islamelshobokshyislamelshobokshy Posts: 99Questions: 20Answers: 1
    edited May 2018

    Thanks for your replies! Can the footer use a json object if I made the ajax call somewhere else?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    The footerCallback just needs access to the data that you want to use - so it can reference a global variable, initiate an Ajax call to get the data itself, or just use it's own logic.

This discussion has been closed.