[Users] treePanel questions

Phil Scadden p.scadden at gns.cri.nz
Wed Nov 10 21:42:16 CET 2010


My method -
             layercontainers = [];
             for (i = 0; i < groups.length;i++){
                 layercontainers[i] = {
                     nodeType: "gx_layercontainer",
                     text:groups[i],
                     layerStore: mapPanel.layers,
                     leaf:false,
                     expanded:true,
                     loader:{
                         group: groups[i],
                         filter:function(record){
                             return record.get("layer").group == this.group;
                         }
                     }
                 };
             }
             tree.setRootNode({
                 children: layercontainers
             });

"group" is an attribute that I added to layers. Actually its easier if 
you add group to options as can then set it in layer constructor.

-- 
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.



More information about the Users mailing list