Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Treegrid with nested (Rest)DataSources

    We are looking for a way to display a tree of nested/related items. We found the showcase item Tree/DataBinding/LoadOnDemand which does something similar but with one datasource (and an internal foreignkey definition).

    We would like to know whether it is possible to define a hierarchical structure with different related (rest)datasources by using foreignkey definitions between the related datasources.

    The example uses a parentId foreignkey which we would also like to use, meaning that data in the sub-datasource would hold the parentId. Is this possible and how would you define such a foreignkey? And would this make the restdatasource to use the Id of the parent as a filter/criteria when fetching the children?

    If this is not possible could you please give us your thoughts on how best to achieve this behaviour?

    #2
    Hi teseling,

    That's actually exactly how the multiDS (multiple DataSource) mode of the ResultTree works, but this is currently undocumented in SmartClient. The right approach for now is just to use a single DataSource that declares whatever subset of the fields are common across the different object types and will be used to form and display the tree (minimally id, parentId, title).

    The records for this DataSource can have whatever other properties you want, and a common strategy is to deliver different sets of properties with each node and have a "type" field which allows you to do different things based on which node was clicked on (for example, show the node data in a different form based on the "type" of the node).

    Comment


      #3
      Forgot to mention, you can always sponsor the work necessary to make the multiDS feature public, supported & documented, with a sample.

      Comment

      Working...
      X