Confirmation on clicking delete button in multiselect control

2 posts, 0 answers
  1. Mahesh
    Mahesh avatar
    1 posts
    Member since:
    Jan 2016

    Posted 23 Mar 2016 Link to this post

    In multiselect control, when user click delete icons of a selected value , it should alert confirmation message and based on user  input "Yes" , "No" it should delete the selection or cancel it.

    I tried as below, it shows confirmation popup but is not waiting for user confirmation

    $(".k-delete").click(function (e) {
                //window.event.cancelBubble = true;
                currentSelection = s.value()
                $("#dlgDeleteSecFromAnalyst").html("Are you sure you want to remove.. clicked.");


  2. Dimiter Topalov
    Dimiter Topalov avatar
    1298 posts

    Posted 25 Mar 2016 Link to this post

    Hi Mahesh,

    You can handle the change event of the MultuSelect and attach a handler to all the items that are selected from the dropdown. Then if the user clicks the "X" to remove any of them, a confirm pops up, and if the user selects "Cancel" the event is stopped from reaching its destination, else the item is removed:

      change: function(e) {
        e.sender.wrapper.find('li.k-button').off().one('click', function(event){
            if(!confirm("Are you sure?")){

    Multiple attachment of the handler to the same event is avoided by unbinding before attaching the handler (... off()...).

    I hope this helps.

    Dimiter Topalov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top