Results 1 to 3 of 3

Thread: how to default select a node of a tree panel in extjs 3.4

  1. #1
    Sencha User
    Join Date
    Feb 2013
    Location
    INDIA
    Posts
    51

    Default how to default select a node of a tree panel in extjs 3.4

    I have a tree panel which have 10 childrens .I want to select default third child of them. what can i do . I am using this code for select but its not work.


    var root = Ext.getStore('MyStore').getRootNode();
    var firstChildNode = root.findChild('leaf', true, true);
    Ext.getCmp('treePnl').getSelectionModel().select(firstChildNode);

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451

    Default

    Is it's parent expanded at the time of selection?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    INDIA
    Posts
    51

    Default

    Thanks for reply ,

    Here is my code which i am using :

    var appManager = new Ext.Panel({
    title: 'My Panel',
    layout:'fit',
    items : [new Ext.tree.TreePanel({
    id:'appManagerMenu',
    loader: new Ext.tree.TreeLoader(),
    rootVisible:false,
    lines:false,
    autoScroll:true,
    root: new Ext.tree.AsyncTreeNode({
    children:[
    {
    text:'Create App',
    iconCls:'app42CreateApp',
    leaf:true,
    },
    {
    text:'App DashBoard',
    expanded : false,
    iconCls:'app42AppDash',
    leaf:true
    }]
    }]
    })
    })
    So i want to App DashBoard child is selected when the panel is called.

Tags for this Thread

Posting Permissions

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