Submit on blur only if data has changed

Submit on blur only if data has changed

Karl53Karl53 Posts: 72Questions: 29Answers: 0

DataTables v1.10.5 and Editor v1.4.0.

Using inline editing with submit on blur.

I'm looking at this Editor example:

https://editor.datatables.net/examples/inline-editing/options.html

With 1,000 scrolling rows in my table, I'm having performance problems when a user tabs from cell to cell. (At times, it takes 2 seconds or more. Even with only 300 rows, the navigation is too slow.).

My thought was I could enhance the navigation performance if submit was call only when the data had been edited by the user.

However, i tried returning false from preSubmit event and this blocks the tabbing navigation.

  1. Is blocking the submit a possible way to improve navigation?
  2. If so, what events should I hook? I need to get the value of the data before the edit and then check if the value has change prior to submitting it in an event that I can block the submit but not the navigation.

Thank you.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Blocking the submission using preSubmit probably is also blocking the tabbing code. You may need to add a little extra code to handle that case.

    That is a valid approach I would say. This is something that I plan to address in a future release - I can't yet say if it will be 1.5 or 1.6, but submitting unmodified data is obviously pointless!

    Allan

  • Karl53Karl53 Posts: 72Questions: 29Answers: 0

    Thanks Allan. As long as you think it is probably a reasonable course, I'll give it a go.

  • daudodaudo Posts: 13Questions: 6Answers: 1

    Hi, just stumbled upon this issue as well.

    Would be nice indeed to see this implemented in a future version.

    For the time being I patched the editor code, but this is not ideal in any way, thinking about potential difficulties later updating to new releases of the Editor.

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Current plan is for this feature to be introduced into Editor 1.5 - the next release (baring any minor bug fixes to the 1.4 series) :-)

    Allan

This discussion has been closed.