Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
igGrid - Display confirm Dialog before deleting a row
posted

I want to display a jquery confirm dialog when the user tries to delete a row. I have already tried to add a jquery dialog in "iggridupdatingrowdeleting" but the JS execution does not stop for the users input and "iggridupdatingrowdeleted" event is fired. Is there a way to callback "iggridupdatingrowdeleted" once the user press the confirm button?

  • 18204
    Suggested Answer
    Offline posted

    Hello voicemetrix,

    Thank you for posting in our forums!

    The events in the igGrid occur synchronously and there is no way to resume the event.  Instead, you can keep track of the rowID and cancel the rowDeleting event, and then call igGridUpdating's deleteRow method to delete the row after user confirmation.

    Since the grid's events do not fire when an action is performed programatically, such as calling the deleteRow method, the rowDeleting and rowDeleted events will not fire again.  If you have any logic in your rowDeleted event, you will need to move it to the OK button in the dialog.

    I have put together this jsFiddle that demonstrates how this can be accomplished.  If you need any further assistance with this, please let me know and I will be glad to help.