Can you create a new record in the callback function of event edit ?
Can you create a new record in the callback function of event edit ?

Here is my sample code:
editor.on('edit', function (e, json, data) {
editor
.create( false)
.set('first_name', 'John')
.set('last_name', 'Smith')
.submit();
}
After the editing was completed, the new record wasn't created. Similarly I created a button to edit a record and then add a new record like this:
editor.edit()
editor
.create( false)
.set('first_name', 'John')
.set('last_name', 'Smith')
.submit();
The new record wasn't created.
It seems that one callback function can only make one form submit. Could anyone confirm that?
Thank you.
Yong
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @Chandler242 ,
The
edit
is called before the previous edit has completed - you need to add you code tosubmitComplete
which is called once the previous edits have all finished. This thread has an example of this,Cheers,
Colin
Hi Colin, Thank you so much. The example shows exactly what I was trying to do.
Regards,
Yong