Binding jaydata entities to ko observable (also included ones)

119 views Asked by At

I am using the jaydata ko modul to load an oData entity into a koObservable. Details are described here.

I'm using the following code:

self.productgroup = ko.observableArray();
context.ProductGroup.include('Product').toArray(self.productgroup);

This is working fine. Except that self.productgroup()[0].Product() are not observable. How can I archive that also the included entities are observable?

Edit (trying to clarify):

self.productgroup()[0].Name <- Is a KO-Observable

self.productgroup()[0].Product().Price <- Is not a KO-Observable

How can I get all extended entities as a KO-Observable?

1

There are 1 answers

0
Robesz On

The productgroup is an array, you have to select an element in it:

self.productgroup()[i].Product()

where i is the index of the array