data-binding on nested ObservableCollection
Can anyone provide an example of how to data-bind to a nested ObservableCollection in a custom UI component?
I have an ObservableCollection which holds some identified features. Each of these features can have a 1->Many relationship with related documents which are retrieved through an Essentials datalink and stored in another ObservableCollection under the main collection.
In the HTML for a custom module, you would normally just use something like:
<span data-binding="{innerHTML:VARIABLE_NAME}"></span>
but I need to get at the members of VARIABLE_NAME and display them as well.A related question - can you use a nested ObservableCollection as the source for a data-binding? Something like data-binding="{@source:mainCollection.nestedCollection}" ?
It would be REALLY nice if Latitude would publish complete documentation on what can be done with the internal data binding of their framework.
0
-
Hi Peter,
Have a look at the "Data Binding - Advanced" sample in the GVH SDK. It does this using templates to represent a nested tree of folders and files.
--Ryan0 -
Ryan,
I've looked at that code but it is geared to recursive rendering of parent/child records that all have the same list of attributes (name,type,children, etc) but my collections have totally different sets of attributes. The parent contains information about the site location, the child records contain information about related documents.
It looks like I would need at least the template selector field to be common to both parent and child in order for it to pick the right template.
Any ideas on whether it could be made to work for this type of parent / child model or will it only work for recursive records with the same model?
Peter.0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
2 kommentarer