Hi, I have a listview that I use Jquery on to be able to have multi-select functionality by simply clicking the items, instead of needing to hold ctrl. When I attempt to gather the selected items using .select(), It implies that because selectable is undefined, that it can't find that information. This was previously a grid and it worked fine having the selectable property off and still using .select(). I also have another grid currently that applies the same functionality and it works. It seems to only be an issue with the listview. I can't set the selectable property to on because with my Jquery doing the selecting, it seems it doesn't know what to do to select and fails.
Here is my selection with Jquery:
$('#expensesView').delegate('.expense', 'click', function () {
$(this).toggleClass('k-state-selected');
})
The listView:
$('#expensesView').kendoListView({
dataSource: ExpensesDS,
//selectable: "multiple",
scrollable: "true",
filterable: "true",
height: 600,
template: kendo.template($('#expenseTemplate').html())
});
Method I'm using to get all the selected objects IDs:
var listView = $('#expensesView').data('kendoListView');
var ids = [];
listView.select().each(function () {
var dataItem = grid.dataItem($(this));
ids.push(dataItem.expenseID);
});
.select works fine on the grid without selectable being defined, but not in the listview. What should I do here?
Thanks!