How to get the selected values of a Checkbox ListView on change?

How to get the selected values of a Checkbox ListView each time I click on a new checkbox?


1 Reply

IL Indhumathy Loganathan Syncfusion Team July 13, 2022 12:30 PM UTC

Hi Ismail,


Greetings from Syncfusion support.


You can retrieve the selected node details after each selection using the select event. Within the event arguments, you can get the current selected list item data. Also, you can use our getSelectedItems method to retrieve all the list items data. Refer to the below code snippet.


select(args) {

    //Get the current selected item.

    console.log(args.data);

    //Get all the selected items each time.

    console.log(this.listObj.getSelectedItems().data);

}


Sample: https://stackblitz.com/edit/react-gki6jr?file=index.js


Reference: https://ej2.syncfusion.com/react/documentation/listview/how-to/get-selected-items-from-listview/


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


Regards,

Indhumathy L


Loader.
Up arrow icon