Results 1 to 5 of 5

Thread: Expand all folders of a GeoExt tree store included in a Ext.tree.panel

  1. #1
    Sencha User
    Join Date
    Jan 2016
    Posts
    11
    Answers
    1

    Default Expand all folders of a GeoExt tree store included in a Ext.tree.panel

    Hi,
    I'm trying to expand all my layer tree built with GeoExt3 and ExtJS6. I'm only able to expand the tree store root (so the top node (see image)). How can I expand all the others nodes ?

    Here's my code:

    Code:
        var treeStore;
        
        treeStore = Ext.create('GeoExt.data.store.LayersTree', {
            layerGroup: olMap.getLayerGroup(),
            root: {
                expanded: true,
                text: "Layers"
            }
        });
    
    
        treePanel = Ext.create('Ext.tree.Panel', {
            title: 'Layers Management',
            viewConfig: {
                plugins: { ptype: 'treeviewdragdrop' }
            },
            store: treeStore,
            rootVisible: true,
            flex: 10,
            border: false
        });
        
        Ext.create('Ext.panel.Panel', {
            renderTo: Ext.get("map"),
            width: "100%",
            height: 800,
            layout: "column",
            items: [
                {
                    xtype: 'panel',
                    height: 800,
                    layout: {
                        type: 'vbox',
                        align: 'stretch'
                    },
                    columnWidth: 0.17,
                    items: [
                        treePanel                        
                    ]
                },                
                {
                    xtype: 'panel',
                    height: 800,
                    columnWidth: 0.83,
                    items: [mapComponent]
                }
            ]
        });
    Here's a screenshot of what I get when the page is loaded.
    screenshot_layertree.png
    Thanks for you help !

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    So the maps are showing but the sub folders won't expand? Any errors or warnings in the console?

  3. #3
    Sencha User
    Join Date
    Jan 2016
    Posts
    11
    Answers
    1

    Default

    Exact. I get no errors, all my layers are working, the folder is just not fully expanded.

  4. #4
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    What does your data look like? Does disabling the GeoExt content fix the issue?

  5. #5
    Sencha User
    Join Date
    Jan 2016
    Posts
    11
    Answers
    1

    Default

    If I replace my TreeStore variable with the TreeStore code example of the documentation, the layer tree is fully expanded like I want it to be with my layers. My data consists of WMS layers and vector layers, but I don't think this is the problem...

Similar Threads

  1. Can't Collapse/Expand Tree Panel after Filtering Store
    By qwerty503 in forum Ext JS 6.x Bugs
    Replies: 6
    Last Post: 17 Jan 2017, 5:26 AM
  2. Replies: 1
    Last Post: 13 Oct 2014, 1:46 PM
  3. Tree Panel and Folders
    By cnhanna01 in forum Ext: Q&A
    Replies: 1
    Last Post: 7 Dec 2011, 8:22 AM
  4. Replies: 4
    Last Post: 2 Jun 2010, 5:21 AM

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
  •