Is there a way to trigger `preSubmit` more than once?

Is there a way to trigger `preSubmit` more than once?

terrasvcterrasvc Posts: 8Questions: 2Answers: 1
edited June 2017 in Free community support

I have preSubmit firing on an editable DataTable, but it only fires the first time the row is edited.

fooBarEditor
  .on('preSubmit', function (e, data) {
    someFunction(data);
    return false;
});

Is there a way to make it fire after every edit, or should I be using a different event?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,970Questions: 1Answers: 10,160 Site admin
    Answer ✓

    You are always returning false from the function, so the first submit would never complete. Is your someFunction actually updating the table? If so, preSubmit isn't how to do this - use ajax to override the submission process.

    Allan

  • terrasvcterrasvc Posts: 8Questions: 2Answers: 1

    Aha, that makes sense. I was trying to tie in to all those events (like preEdit and preSubmit), but using ajax will work for our needs! Thank you!

This discussion has been closed.