Announcement

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

    How to get the parent of a selected node in a TreeGrid?

    Hi,

    I've been looking thru the API and the forums for a way to get the parent of a node in a TreeGrid. My problem is that, when an external event is fired I need to get the selected node and know its father.

    So far, the only method available returns a ListGridRecord. I can't see a way to get the underlying TreeNode structure.

    Do you know how the parent of a selected node ? For this matter, how can you get the underlying model ? That'd be really useful.

    Thanks in advance,
    Juan

    #2
    Those objects are interconvertible (it's the same underlying object). Create an instance of TreeNode using the JavaScriptObject available from ListGridRecord.

    Comment


      #3
      You can call this static method in the Tree class.

      TreeNode nodeForRecord(ListGridRecord record);

      Comment


        #4
        I wasn't very clear I fear: when I said 'TreeNode structure' I mean 'Tree structure' so that you can get the parent, children, etc, of each node.

        I can't see a method to get a Tree object out of a TreeGrid or a TreeNode...

        Comment


          #5
          TreeGrid.getData or its synonym TreeGrid.getTree()

          Comment

          Working...
          X