I have a listview defined as follows:
<div data-role=" listview"
data-template="template"
data-bind="source: people,
visible: isVisible,
events: {
change: onChange
}"
style="float:left; width:100%; height: 370px;display:block;overflow: auto">
</div>
now listview nicely shows my array of items but I need to update another view when the user selects a new row.My VM looks like:
var viewModel = kendo.observable({
isVisible: true,
onChange: function (){
debugger;
var data = dataSource.view(),
selected = $.map(this.select(), function (item) {
return data[$(item).index()].ProductName;
});
kendoConsole.log("Selected: " + selected.length + " item(s), [" + selected.join(", ") + "]");
},
onSave: function (e) {
kendoConsole.log("event :: save(" + kendo.stringify(e.values, null, 4) + ")");
},
person: {
Name:"John Doe"
},
.....
notice the debugger statement in the onChange function , well it is never hit as no idea what happened to the change event. I would have used Angular but
it has a problem that caused us to drop back to MVVM (Knockout). even if I make onChange a global function it does not fire.
Very confused