I'm using the Cairngorm framework to dynamically add nodes to my 
tree. I use a custom object I created that has public properties: 
nodeid, nodename, and children.

Everything works fine when adding hard coded object nodes in 
the "execute" function of my Command class. ex.

var _node:TreeNodeVO = new TreeNodeVO();        
_node.nodeid = 1
_node.nodename = "Root";

_tree.addItem(_node);


The issue comes in where I make dynamic call to the server when the 
user clicks on the "Root" node and the results come back into 
the "result" function of my Command class. While debugging I noticed 
that the "Root" node on the treeview must of fired its expand event 
because the "Open" icon was shown. Once I added the new children 
they did not up under the parent. I tried to call force an expand 
call again like this
trData.expandItem(_treeNodeVO,_expand,false,true,null);
but that still didnt work. Once I closed the main parent node and 
clicked on it again the children nodes "did" show.

So I have concluded that somewhere between the "execute" function 
and server call the node expand event is fired before the "result" 
function. My main question is what can I do so the children will be 
seen? force and event to be fired? Call a method off the tree 
itself? etc....

 <mx:Tree labelField="nodename" id="tvModuleView" width="100%"  
height="100%" showRoot="false"                                    
                                                                     
                                 
itemOpen="treeModelViewHelper.addNodes(TreeNodeVO
(event.item),true)"                                             
                                
                                     
dataProvider="{ModelLocator.getInstance().treeViewModuleList}" 
                                                         
folderOpenIcon="@Embed
(source='/assets/images/treeicons/dsChild.gif')"
                                                         
folderClosedIcon="@Embed
(source='/assets/images/treeicons/dsParent.gif')"
                                                         
defaultLeafIcon="@Embed
(source='/assets/images/treeicons/dsRoot.gif')" />        

Thanks







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to