Hi there,
slowly getting used to this MVVM thing but I still have some problems.
I set up my viewmodel as a kendo.observable and also set a datasource and a method:
My orders (the list) is displayed without any problem (tho it took me some time to accomplish that)
Now I'm trying to display the corresponding details for each order in my detailsView:
Nothing happens...
When I am moving the showOrderDetail out of my viewmodel (as function showOrderModel(e){ ...} everything works.
But I want to capsule the corresponding functions of a model (which is showing details) into that model. Or am I missing sth?
Hope someone can point me into the right direction.
Thx
slowly getting used to this MVVM thing but I still have some problems.
I set up my viewmodel as a kendo.observable and also set a datasource and a method:
var
orderViewModel = kendo.observable({
orderList: orderDS,
showOrderDetail:
function
(e) {
var
view = e.view;
orderDS.fetch(
function
() {
var
model = view.model,
item = orderDS.get(view.params.id);
model.set(
"order"
, item)
});
}
});
My orders (the list) is displayed without any problem (tho it took me some time to accomplish that)
Now I'm trying to display the corresponding details for each order in my detailsView:
<
div
id
=
"orderDetail"
data-role
=
"view"
data-layout
=
"mobile-tabstrip"
data-title
=
"Orders"
data-model
=
"orderViewModel"
data-show
=
"showOrderDetail"
>
<
p
data-bind
=
"text: order.total"
></
p
>
</
div
>
Nothing happens...
When I am moving the showOrderDetail out of my viewmodel (as function showOrderModel(e){ ...} everything works.
But I want to capsule the corresponding functions of a model (which is showing details) into that model. Or am I missing sth?
Hope someone can point me into the right direction.
Thx