AJAX Remove, no reload

AJAX Remove, no reload

chrisvirtualiticschrisvirtualitics Posts: 2Questions: 1Answers: 0

Hi,

I am trying to execute some longer processes server-side on a row removal, and am wondering how I can prevent datatables from reloading the page after I submit a delete event. I tried, e.preventDefault() in the success parameter to the overriden ajax for the editor removal option, but that stopped anything from happening.

How would someone stop the page reload on only a single AJAX override event in Editors?

Thanks!
Chris

Answers

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin

    Are you using server-side processing (that would cause the table for the whole DataTable page to be refetched on each draw)? If so, and you want to prevent that and have no table update, you can use the drawType parameter of form-options set to be none.

    Allan

  • chrisvirtualiticschrisvirtualitics Posts: 2Questions: 1Answers: 0

    I am not using the included PHP server-side processing, I have a backend in python returning json data to front end and parsing that in JS.

    I want to only override one of ajax options in the Editor. For Remove, i want to not reload the page and redraw the table. I want to wait for a response from my server and manually call it myself on a successful response.

    Will form-options solve this?

    Thanks!
    Chris

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin

    When you say "reload the page" - do you mean a full page reload? Editor will never do a full page reload, as can be seen here. Only if you have an event handler on submitComplete that is triggering the reload would the page actually do a full reload.

    Can you give me a link to the page so I can take a look?

    Allan

This discussion has been closed.