Announcement

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

    TreeNode isLeaf with RestDataSource

    Hello,

    i want to display a tree in a TreeGrid that is usind a RestDataSource returning XML Data.

    It is working fine, but the problem is, that every node can be expanded regardless if it is a childrennode or not. If I click on a node that has no children, the root item become closed.
    TreeNode has a method
    http://www.smartclient.com/smartgwt/...Folder(boolean)
    or Tree has
    http://www.smartclient.com/smartgwt/....tree.TreeNode)
    I can not use this method, because of the RestDataSource.
    Can I set properties in the XMLanswer to determine whether this node has children or not which means is it expandable or not.
    For now I set only the fields that i have defined in the datasource.

    BestRegards
    Jakob

    #2
    Yes, the default value of the isFolderProperty is "isFolder", so just add nodes that say isFolder:"false" where you don't want folders.

    Comment


      #3
      To further clarify, the XML returned to the RestDataSource can include the following:

      <record>
      <isFolder>false</isFolder>
      ...
      </record>

      to indicate that record is a "leaf" node and doesn't have children.

      Comment


        #4
        that works!
        Does that mean that I can set every property for which a getter or setter on a tree or record exist in that way?

        Thank you :)

        Comment


          #5
          Yes, DataSource fields correspond to ListGridRecord / TreeNode properties.

          Comment

          Working...
          X