Reputation: 18306
I have some data which are loaded to table via jquery/ajax. Table has a column to do delete action on each row.Actions are also done by ajax call and fadingOut the row to hide it from user.
If the user click on delete icon, a dialogbox should be appear to give the reason of removing from user, submission of form should be done by ajax too, and of course the user can cancel this dialogbox, so the row shouldn't fadeOut.
I am confused with these multiple ajax call. How can I get if the user cancel the form or submitted it to determine the need of hiding row?
Upvotes: 0
Views: 89
Reputation: 15835
As you didn't provide the code, I can assume and tell you.
The main logic is to grab the current cell, which you do by:
$(this).attr('id');
Upvotes: 1
Reputation: 437386
You can determine if the user submits or cancels the form by attaching different handlers to the click
events of your submit and cancel buttons.
If the cancel button is clicked, the form will not be submitted at all (there will not be an AJAX call) because you won't need to do anything at all.
If you already have code for the dialog box with the form and the AJAX call, post the relevant parts so that we can expand further.
Upvotes: 1