Re-Post serverside without reloading table

Re-Post serverside without reloading table

dhutton@creativeone.comdhutton@creativeone.com Posts: 59Questions: 15Answers: 0

I've wired up an endpoint serverside that both hands off data to the table during load as well as return a file if exporting csv. I need a reminder how to send a POST to the server without re-drawing the table. table.ajax.reload() does what I need but it reloads the table and generates an error, since I'm feeding back a file instead of the JsonResult the table needs. I want the export to mirror the same filter / order settings involved with a normal paginated api / serverside set up, I just need the table to stay put when someone hits my export button.

Thanks!

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Sounds like you want to make an Ajax call but not through DataTables. jQuery.ajax could be used, or the newer fetch API.

    If you need to know the parameters that DataTables sends to the server (so your script can do things like sorting and filtering) use the ajax.params() method.

    Allan

  • dhutton@creativeone.comdhutton@creativeone.com Posts: 59Questions: 15Answers: 0

    That's exactly it, thank you Allan!

Sign In or Register to comment.