I changed the function to :

private function lblFunc(oItem:Object):String
       {


           if (oItem.hasChildNodes()){
                  return oItem.getProperty("deptDesc");
            }
            else
                  { return oItem.getProperty("empName");

       }
}




                                                                                
                                            
                                                                                
                                            
             [EMAIL PROTECTED]          To: [email protected]          
                                     
             Sent by:                          cc:                              
                                            
             [email protected]        Subject:  [flexcoders] How to 
use the label Function in a Tree that has      
             09/02/2005 01:53 PM                 different labels in the 
parents and the children.                          
             Please respond to                                                  
                                            
             flexcoders                                                         
                                            
                                                                                
                                            
                                                                                
                                            




I am trying to populate a Tree with a result that has hierarchical data. It
actually populates correctly but the parent and the children don't have the
same label description, and the children are displaying as
[object][object]. I am using a label function to get the parent label name,
and that's working fine. However, I don't know how to point to the right
label description in the children.

 This is the function I am using. As I said it only works for the parent.
 private function lblFunc(oItem:Object):String
       {

            return oItem.getProperty("deptDesc");


       }

This is the hierarchical structure. It is mainly and Array of departments,
and each of them has an attribute called employeeColl which is an Array of
employees for the department. This shows one of the departments.

          employeesColl: [{empCode: "emp1",
                    empName: "Emp 1",
                    empDate: null},
                        {empCode: "emp2",
                    empName: "Emp 2",
                    empDate: null},
                        ],
          deptCode: "Commer",
          deptDesc: "Some Department"

 How can I change lblFunc  such that it can take empName for label
description in the children?

   So far I am getting something like this:

               -   Some Department
                        -- [object][object]
                        -- [object][object]
 what I want to get:

               -   Some Department
                        -- Emp 1
                        -- Emp 2
Thanks,

---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------





--
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











---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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/

<*> 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