How to get the event of deleting chip?

Hello,
I am woriking with chips in Vue now,and I need to get an event when I delete the chip to modify my data source.
Could you provide it please?


3 Replies 1 reply marked as answer

LD LeoLavanya Dhanaraj Syncfusion Team September 6, 2022 10:24 AM UTC

Hi Nurbek,


Greetings from Syncfusion support.


Based on your requirement, we have prepared a Vue Chips sample with the latest version. We have an event called delete which will trigger before removing the chip element. This will only apply if the Chip component's enableDelete property is enabled and its value is set to true.


Refer to the below mentioned code snippets.


[App.vue]

<ejs-chiplist id="chip" enableDelete="true" :delete="deleteIconHandler">

    <e-chips>

        <e-chip text="Andrew"></e-chip>

        …

    </e-chips>

</ejs-chiplist>

 

methods: {

    deleteIconHandler: function (e) {

        console.log("You can write your own customization");

    },

},


Sample : https://codesandbox.io/s/adoring-diffie-1g1kz6?file=/src/App.vue


Please check the attached sample and get back to us if you need any further assistance.


Regards,

Leo Lavanya Dhanaraj


Marked as answer

NU Nurbek replied to LeoLavanya Dhanaraj September 8, 2022 08:48 AM UTC

Thank you!



SS Shereen Shajahan Syncfusion Team September 9, 2022 05:01 AM UTC

Hi Nurbek,


If you are satisfied with our response, please mark it as an answer. Otherwise, please let us know if you have any further queries on this. We are happy to help you.


Regards,

Shereen


Loader.
Up arrow icon