Professional Web Applications Themes

three add branch keep other branches open - Macromedia Flex General Discussion

Assigning the dataProvider will always cause the tree to be completely re-rendered, and will initialize the nodes to their default disclosure state. You have two options in 1.5 (2.0 makes this much easier): 1. Keep track of the open status of the nodes, by storing some key that will identify that node. After the tree is re-rendered, recursively travel every node, searching for the open branches. When you find one, climb back up the tree, opening each node as yo go until you reach the root. If you are careful you can make this pretty efficient, because you only need ...

  1. #1

    Default Re: three add branch keep other branches open

    Assigning the dataProvider will always cause the tree to be completely
    re-rendered, and will initialize the nodes to their default disclosure state.

    You have two options in 1.5 (2.0 makes this much easier):
    1. Keep track of the open status of the nodes, by storing some key that will
    identify that node. After the tree is re-rendered, recursively travel every
    node, searching for the open branches. When you find one, climb back up the
    tree, opening each node as yo go until you reach the root. If you are careful
    you can make this pretty efficient, because you only need to store-restore the
    open state of the last open node in the branch, since all of its parents must
    be also open.

    2. Do not re-assign the dataprovider. Instead use the dataProvider methods to
    update the dataProvider. This should make the tree respond visually, without
    completely re-rendering. This might be more difficult.

    Since I only needed to restore a single, selected node, I used the first
    option. The second would be much more efficient and long term flexible if you
    can make it work.

    In flex 2.0, you just save the array "selectedItems", then assign that array
    back to selectedItems to restore the state. Cool, huh?

    Tracy

    ntsiii Guest

  2. #2

    Default Re: three add branch keep other branches open

    Tracy

    thank you very much for help. sometimes to know you can not do somthing is as
    helpful as knowing how to do it!

    i my try to go with my own seletedItems structure, so i can reopen opened
    brunches.

    we are stuck with 1.5 as my boss said :-( - 2 2 big a change, uncharted
    grounds...

    thanks again

    P.S three = 3 not a tree and i am sorry for mistake



    krisk58 Guest

Similar Threads

  1. AdvancedDataGrid Tree Branch id
    By Brent Wientjes in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: April 26th, 06:00 AM
  2. Branch office slow login
    By Edward in forum Windows Server
    Replies: 5
    Last Post: June 28th, 11:53 AM
  3. how to make a tree branch
    By mystikaldeb in forum Macromedia Fireworks
    Replies: 3
    Last Post: August 22nd, 03:01 PM
  4. Way out for Branch database
    By niitmalad in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 9th, 06:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139