Can I modify the request type of my inline Editor AJAX call based on the edited cell values?

Can I modify the request type of my inline Editor AJAX call based on the edited cell values?

riptusk331riptusk331 Posts: 1Questions: 1Answers: 0

I want to use Editor in such a manner that if the cell I edit is initially blank and I edit it to contain data, it sends a POST request. If the cell already contains data and I edit that, I want it to send a PUT request.

I know that I can submit an object to the ajax option with what to do for "create", "edit", "delete", etc. In my case, Editor will think it's an "edit" action all the time - I want to determine the request type based on the type of edit.

Answers

  • allanallan Posts: 63,210Questions: 1Answers: 10,415 Site admin

    You'd need to use ajax as a function and then call $.ajax() (or fetch or whatever you prefer) directly.

    There isn't a way to modify the verb that Editor sends from its default Ajax call on-the-fly based on the data I'm afraid. Using your own function would be the only way to do it.

    Allan

This discussion has been closed.