RowID value on create
RowID value on create
I know I'm in the ballpark, but it seems I'm always in the ballpark haha Okay, here we go.
I need to get the row ID of a newly created row. I have the following code:
editor
.on( 'submitSuccess', function () {
val = editor.val( 'projdetail.details' ); <<<<<<<<<<<<<<<<<?????
} )
.on( 'edit', function () {
if ( editor.val( 'projdetail.details' ) !== val ) {
$.post( "detail_notifications.php", { projdetid: editor.val('projdetail.projdetid') } );
}
} );
Now, this works when I edit a row. And I can clearly understand why. In my editor, I already have a value of that row ID. But when I create a row, that row ID is automatically created by the database, so the editor doesn't have it.
How would I go about getting that value after a successful submission?
This question has an accepted answers - jump to answer
Answers
When you create the row, the server should be returning the new id in the returned data for the Ajax request. You would then use the second parameter passed into the
create
method to be able to access that data.The second parameter passed into
submitSuccess
also contains that same data.Allan
Example using
postCreate
:Allan