Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I access the selected items in Kendo UI's ListView?

I love the control and from visual perspective it provides me with exactly what I want (selecting multiple items, etc) but I don't see any documentation or tutorials explaining how to access a collection with the selected items or even determine which items are selected.

I thank you in advance for you help with such a basic question.

like image 462
Robert Kaucher Avatar asked Dec 17 '12 21:12

Robert Kaucher


1 Answers

You should use select method for getting the list of nodes selected.

Given the following initialization:

var list = $("#list").kendoListView({
    dataSource: data,
    template  : "<li>${title}</li>",
    selectable: "multiple"
}).data("kendoListView");

You can use:

var selected = list.select();
console.log("selected", selected);

Check the documentation about select here

like image 120
OnaBai Avatar answered Sep 22 '22 10:09

OnaBai