Inside selContentItem() shouldn't e.sender be the kendoListView and thus the same as (in this case) $('#contentListView').data('kendoListView')? When I break and debug, it looks like it (though == returns false), but e.sender.dataSource is empty.
$(
'#contentListView'
).kendoListView({
dataSource: data
, template: kendo.template($(
"#template"
).html())
, selectable:
"single"
, schema: {
model: {
children:
"Children"
, id:
"id"
, hasChildren:
"hasChildren"
}
}
,change: selContentItem
});
function
selContentItem(e) {
//I would expect the following to return true and if it did (and similar logic followed), the next line would work nicely but it doesn't because the first line returns false. Why?
console.log(e.sender == $(
'#contentListView'
).data(
'kendoListView'
));
console.log(e.sender.dataSource.view()[e.sender.select().index()]);
}