views:

68

answers:

1

hi,

i have a tree of nodes that i dont want some type of nodes to appear in the tree, i can check the data on tree item renderer for each specific node type, so i have one type that i dont want it to be shown as tree node, like it doesn't exist.

if(this.data.type == TypeEnum.id){
            this.visible=false;
            this.height = 0;
        }
        else {
+1  A: 

how about something like this:

public function init(e:Event):void{
   if(this.data.bad==true){
      this.visible=false;
      this.height=0;
      this.width=0;
   }
}

or just add some filter function like here

Eugene
didn't work, first option stalls the program with white screen, even its exactly what i need, and the second one works with xml data, could i use it with objects?
seismael
Hi again, it worked after i removed the width statement, but in a strange way, the nodes disappeared,but some height still exists... i need the discloser icon for other nodes that are not this type i want to disappear... but when opening the nodes.... any node that disappears keeps some empty height.
seismael
i mean this function inside of itemRenderer component. and second link will work fine with any type of data, just modify it.
Eugene
and show me your code, you could use something like pastebin.com
Eugene
ok, thanks for the help, i will modify the example to work for me... but i was wounding why the node disappeared but the height which is zero still affects the tree, i used this code in the update display function... and its much easer to use inside the item renderer
seismael
try to call something like `container.invalidatedisplaylist` after removing current data from itemRenderer from dataProvider. or make a height to zero and try to apply dynamic height in settings of container.
Eugene
thanks for help :)
seismael
you're welcome)
Eugene