on listview delete button click, how to display a confirm box before calling destroy action?

1 Answer 339 Views
ListView
Ashwini
Top achievements
Rank 1
Ashwini asked on 12 Jul 2021, 08:34 PM

Hi,

I have the requirement where I need to get the confirmation from the user when they click on the delete button in the listview before proceeding to destroy action. I am trying to subscribe to the click event on the delete button to cancel the destroy action. But I am unable to do so as Kendo has already bound the delete button click to destroy action.

 

Please suggest/guide on how I can get a confirm box displayed before proceeding to destroy action.

 

Thanks,

Ashwini

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 15 Jul 2021, 08:59 AM

Hi, Ashwini,

The delete action is indeed wired to the button that has the class "k-delete-button". Therefore, adding another click handler would not prevent the initial one from executing.

What I can recommend is that you set up the edit template to not feature the "k-delete-button" class. Therefore, you should attach your own handler where you will prompt the user for confirmation. Depending on the selection, access the currently edited data item and manually delete it.

I hope you find this helpful.

 

Regards,
Tsvetomir
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ListView
Asked by
Ashwini
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or