Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: how to make treepanel auto expand

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    70

    Question how to make treepanel auto expand

    This is my tree panel.i want to expand the treepanel automaticaly when we open..how to do this if anyone know please help me
    Code:
    var Menu_Tree = new Ext.tree.TreePanel({
                        title:'OOH CRM',
                        autoScroll:true,
                        region:'west',
                        animate:true,
                        enableDD:false,
                        containerScroll: true, 
                        split:true,
                        collapsible:true,
                        titleCollapse:true,
                        width:175,
                        loader: new Ext.tree.TreeLoader({
                            dataUrl:'../common/get_menu.jsp?moduleid=crm'
                        }),
                        loadingText:'Loading',
                        root:new Ext.tree.AsyncTreeNode({text:'Main Menu',expanded:true})
                    });

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Expand the treepanel or the tree nodes?

  3. #3
    Sencha User
    Join Date
    Jul 2009
    Posts
    70

    Default

    can you please help me with sample code.how to expand

  4. #4
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    how about answering my question first

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Your root node will be expanded on render. It will show all of the children that "../common/get_menu.jsp?moduleid=crm'" returned.

    And when you check Firebug, what exactly got returned?

  6. #6
    Sencha User
    Join Date
    Jul 2009
    Posts
    70

    Question

    Well I tried it on the main menu
    Code:
    var Menu_Tree = new Ext.tree.TreePanel({
                        title:'OOH CRM',
                        autoScroll:true,
                        region:'west',
                        animate:true,
                        enableDD:false,
                        containerScroll: true, 
                        split:true,
                        collapsible:true,
                        titleCollapse:true,
                        width:175,
                        loader: new Ext.tree.TreeLoader({
                            dataUrl:'../common/get_menu.jsp?moduleid=crm'
                        }),
                        loadingText:'Loading',
                        root:new Ext.tree.AsyncTreeNode({text:'Main Menu',expanded:true})
                    });
    but the tree load main menu automatically not the OOH CRM
    But i need to make it expandable as the 2 picture when the window loads
    Attached Images Attached Images

  7. #7
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    And......... are the child nodes set to 'expanded : true' ?

  8. #8
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    And......... are the child nodes set to 'expanded : true' ?

  9. #9
    Sencha User
    Join Date
    Jul 2009
    Posts
    70

    Default

    This only am getting in firebug
    Code:
    [{'text' : 'OOH CRM', 'id' : 400000, 'leaf' : false,'cls' : 'folder', 
    'children' : [{'text':'Campaign', 'id':'40000', 'leaf' : true, 'iconCls' : 'CampaignIcons', 'href' : 'javascript:crm_PageLoad(40000,"Campaign","../crm/campaign_list.jsp")'},
    {'text':'Lead', 'id':'40005', 'leaf' : true, 'iconCls' : 'leadicon', 'href' : 'javascript:crm_PageLoad(40005,"Lead","../crm/lead_list.jsp")'},
    {'text':'Reports', 'id':'40060', 'leaf' : true, 'iconCls' : 'piechartIcon', 'href' : 'javascript:crm_PageLoad(40060,"Reports","../crm/qry_master_desingner.jsp")'}]}]

  10. #10
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    yeah, i don't see expanded anywhere in there.

Page 1 of 2 12 LastLast

Posting Permissions

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