After an Edit/Multi-Edit operation the AJAX url / DT reload is trigged

After an Edit/Multi-Edit operation the AJAX url / DT reload is trigged

chopstikchopstik Posts: 14Questions: 5Answers: 0

Hi Alan, I'm seeing after a single or multi-row Editor edit event the DT refreshing itself? The server reponse to the edit event is fine in that an object is returned to DT with the most recent data. I'm wondering if the full reload is necessary and can it be controlled at all?

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin
    Answer ✓

    Do you have server-side processing enabled? If so, then yes, a reload is required because that's how server-side processing works. Every draw of the table must make a request to the server.

    It is a little redundant since it would be possible to continue the draw information in the JSON response that Editor has, but that isn't something that it currently does, in part because there is no API for that in DataTables core.

    So at the moment, yes, if you are using server-side processing you need an Ajax request for the submit of the edited data and then one for the redraw of the table.

    Regards,
    Allan

  • chopstikchopstik Posts: 14Questions: 5Answers: 0

    Server-side processing is switched on, yes. Just so I'm clear the JSON data I'm returning post-edit is not actually used in any way and the re-load/re-draw is happening out oy my control and by design at this point?

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin
    Answer ✓

    Editor will actually use the JSON returned - for example any error messages shown. If the request is successful then it will shortcut the local update and simply to the draw() request to get the latest data.

    So yes, this is by design just now - even if it is sub-optimal I'm afraid.

    Allan

This discussion has been closed.