1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    xiangying.su@lmco.com is on a distinguished road

      0  

    Default expandAll methd for partially expanded tree

    expandAll methd for partially expanded tree


    It looks like the expandAll() method does not work when a tree in a Ext.tree.Panel is partially expanded already. We are using EXTJS v4.0.7. Is this an issue in v4.0.7? How about if we upgrade it to the newest v4.1.1?

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi,

    Try following code its working fine at my end in Extjs4.x

    Code:
    var store = Ext.create('Ext.data.TreeStore', {
        root: {
            expanded: true,
            children: [
                { text: "detention", leaf: true },
                { text: "homework", children: [
                    { text: "book report", leaf: true },
                    { text: "alegrbra", leaf: true}
                ] },
                { text: "homework", children: [
                    { text: "book report", leaf: true },
                    { text: "alegrbra", leaf: true}
                ] },
                { text: "buy lottery tickets", leaf: true }
            ]
        }
    });
    
    
    Ext.create('Ext.tree.Panel', {
        title: 'Simple Tree',
        width: 200,
        height: 150,
        store: store,
        rootVisible: false,
        tbar: [
            { xtype: 'button', text: 'Button 1', handler:function(btn){
                btn.ownerCt.ownerCt.expandAll();
            } }
         ],
        renderTo: Ext.getBody()
    });
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    xiangying.su@lmco.com is on a distinguished road

      0  

    Default


    Thank you sword-it for your test code. Your store works in my end, too. However, when I added two childern under the "algebra" (algebra I & II) then they cannot be expanded in a partially expanded tree.

    So it looks this is an issue if the tree store has multi-layer of children (grandchildren of grandchildren).

    Below is my store merely with algebra I & II added:

    var store = Ext.create('Ext.data.TreeStore', {
    root: {
    expanded: true,
    children: [
    { text: "detention", leaf: true },
    { text: "homework", children: [
    { text: "book report", leaf: true },
    { text: "alegrbra", children: [
    { text: "algebra I", leaf: true },
    { text: "algebra II", leaf: true }
    ]}
    ] },
    { text: "homework", children: [
    { text: "book report", leaf: true },
    { text: "alegrbra", leaf: true}
    ] },
    { text: "buy lottery tickets", leaf: true }
    ]
    }
    });

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi