<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html><head><meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
<style>BODY{font:10pt Tahoma,Verdana,sans-serif} .MsoNormal{line-height:120%;margin:0}</style></head><body>
Hi,<br><br>I think this belongs more to the sencha forums, but here it goes.<br><br>For the feature info:<br>When creating the grid for the featureinfo you can do something like this:<br>var grid = Ext.create(Ext.grid.Panel, {/* options */ });<br>When loading new data, you reference the grid variable:<br>var store = grid.getStore();<br>store.load();<br><br>For the treepanel:<br>I don't know if this has to do with the new class system, but for the listener to be aware of the global scope, you have to set this. Like:<br>listeners: {<br>    checkchange: function(node, check) {<br>    },<br>    <b>scope:this</b><br>
                        }<br><br>You can also look up the nodes itself, instead of setting them as globals. Explanation here: http://stackoverflow.com/questions/13139150/select-treepanel-node-by-id<br>I don't know why .setVisiblity() is undefined for layer1,layer2, etc. For that I have to know how you store them (and thus what kind of object they are).<br><br>You problems have little to nothing to do with openlayers, and more with extjs. <br><br>I hope that helps!<br><br>Kind regards!<br><br>Met vriendelijke groet,<br><br>Meine Toonen<br>B3Partners BV<br>Tel: 030 214 2083<br><blockquote style="padding-left: 5px; margin-left: 5px; border-left: #0000ff 2px solid; margin-right: 0px"><hr><b>From:</b> svranic.gf [mailto:svranic@geof.hr]<br><b>To:</b> openlayers-users@lists.osgeo.org<br><b>Sent:</b> Wed, 09 Oct 2013 13:14:37 +0100<br><b>Subject:</b> [OpenLayers-Users] ExtJS 4 Class system and Openlayers<br><br>Hi everyone,<br>
I am having problems with integrating Openlayers and ExtJS 4. I had no<br>
problems with embeding map within ExtJS panel. I have troubles with<br>
following features:<br>
Feature info - I can catch map click and I get based on the coordinates data<br>
in json format. Store, model and grid are configured correctly because it<br>
works on a local json file. On a map click store should be reloaded. It<br>
should probably be reloaded from click handler defined in a file where I<br>
defined OL app and click event but I don't know how because of new class<br>
system of ExtJS 4, i.e. how should I reference store and how should I call<br>
.load() method<br>
<br>
Tree panel - layer swithcher - with this one problem is following: Firebug<br>
first reported that it cannot see variables layer1, layer2 and layer3. I<br>
defined as global in my olApp.js file. Next, error occured that stated:<br>
method setVisibility() is not defined. Question: How can I call any method<br>
defined in Openlayers from ExtJS when using MVC architecture with new ExtJS<br>
4 class system?<br>
<br>
        Ext.define('app.view.LayerSwitcherTreePanel', {<br>
                extend: 'Ext.tree.Panel',<br>
                alias: 'widget.layerSwitcherTreePanel',<br>
                title: 'Layers',<br>
                listeners: {<br>
                        checkchange: function(node, check) {<br>
                                if (node.get('id') == 'layer1') {<br>
                                        layer1.setVisibility(true);<br>
                                        layer2.setVisibility(false);<br>
                                        layer3.setVisibility(false);<br>
                                } else if (node.get('id') == 'layer2') {<br>
                                        layer1.setVisibility(false);<br>
                                        layer2.setVisibility(true);<br>
                                        layer3.setVisibility(false);<br>
                                } else if (node.get('id') == 'layer3') {<br>
                                        layer1.setVisibility(false);<br>
                                        layer2.setVisibility(false);<br>
                                        layer3.setVisibility(true);<br>
                                }<br>
                        }<br>
                },<br>
                root: {<br>
                        text:'All layers',<br>
                        expanded:true,<br>
                        children:[{<br>
                                text: 'Layer set 1',<br>
                                expanded: true,<br>
                                children: [{<br>
                                        text: 'Layer 1',<br>
                                        id: 'layer1',<br>
                                        leaf: true,<br>
                                        checked: true<br>
                                }, {<br>
                                        text: 'Layer 2',<br>
                                        id: 'layer2',<br>
                                        leaf: true,<br>
                                        checked: false<br>
                                }, {<br>
                                        text: 'Layer 3',<br>
                                        id: 'layer3',<br>
                                        leaf: true,<br>
                                        checked: false<br>
                                }]<br>
                        }, {<br>
                                text:'Layer set 2',<br>
                                expanded: true,<br>
                                children:[{<br>
                                        text:'Layer xyz',<br>
                                        id: 'layerxyz',<br>
                                        leaf:true,<br>
                                        checked: true<br>
                                }]<br>
                        }]<br>
                }<br>
        });<br>
<br>
<br>
To summarize, I have a feeling that only problem with my application is<br>
visibility of method and variables accross two JS frameworks.<br>
<br>
I hope that everything I wrote is more or less clear. If not or if<br>
additional code is required please let me know.<br>
<br>
Cheers<br>
Sasa<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/ExtJS-4-Class-system-and-Openlayers-tp5082576.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/ExtJS-4-Class-system-and-Openlayers-tp5082576.html</a><br>
Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</blockquote><style>
</style>
</body></html>