[Users] I can not work with two simultaneously gridpanel based on GeoExt.data.FeatureStore within differents windows

jcortega at dipalme.org jcortega at dipalme.org
Wed Aug 8 12:56:24 CEST 2012


Hi,
 
When I add one second ext gridPanel (gridPanelrs)  based on 
GeoExt.data.FeatureStore  in a new window does not work for the first 
gridPanel (gridPanelmu), exactly it dissapears the data of the first 
grdPanel
My code is:

storemu = new GeoExt.data.FeatureStore({
                        layer: vectorLayer,
                        fields: fieldsmu,
                        proxy: new GeoExt.data.ProtocolProxy({
                                protocol: new OpenLayers.Protocol.HTTP({
                                        url: 
"app/lib/app/postgis_geojson.php?geotable=eiel_map_municipal.municipios_sde&orderby=nombre",
                                        format: new 
OpenLayers.Format.GeoJSON()
                                })
                                })
 
                        //      autoLoad: true
                });
 
                storemu.load({
                                        params: {municipio: 
municipioseleccionado, order_by:ordenapor}
                                        });
 
        var filtemu = new Ext.ux.grid.GridFilters({filters:columnsmu});
                var selectormu = new GeoExt.grid.FeatureSelectionModel();
        var gridPanelmu =  new Ext.grid.GridPanel({
        ref: "gridPanelmu",
                id: "gridPanelmu",
                title: 'municipios',
        region: "east",
        store: storemu,
                plugins: filtemu,
        // store: ['abla','04001'],
                stripeRows: true,
        tbar: [],
                width: 400,
                height: 600,
        columns: columnsmu,
        sm: selectormu 
       });

var  myWinalfamu = new Ext.Window({ 
                        id     : capa,
                        height : 400,
                        width  : 500,
                        closeAction: "close",  // hide esto evita un error 
al abrir por segunda vez la ventana "me.dom error"
                        resizable: true,
                        items  : [gridPanelmu]// los corchetes tiene que 
estar porque si no, no salen los datos
                }); 
 
           myWinalfamu.show(); 


The second store, gridPanel and window is practical the same code but 
changing the names:

storers = new GeoExt.data.FeatureStore({
                        layer: vectorLayer,
                        fields: fieldsrs,
                        proxy: new GeoExt.data.ProtocolProxy({
                                protocol: new OpenLayers.Protocol.HTTP({
                                        url: 
"app/lib/app/postgis_geojson.php?geotable=eiel_map_municipal.ramal_saneamiento&orderby=ord_tramo&municipio=municipioseleccionado",
                                        format: new 
OpenLayers.Format.GeoJSON()
                                })
                                })
 
                        //      autoLoad: true
                });
 
                storers.load({
                                        params: {municipio: 
municipioseleccionado, order_by:ordenapor}
                                        });
 
 
 
        var filters = new Ext.ux.grid.GridFilters({filters:columnsrs});
        var selectorrs = new GeoExt.grid.FeatureSelectionModel();
        var gridPanelrs =  new Ext.grid.GridPanel({
        ref: "gridPanelrs",
                id: "gridPanelrs",
                title: 'redes_saneamiento',
        region: "east",
        store: storers,
                plugins: filters,
        // store: ['abla','04001'],
                stripeRows: true,
        tbar: [],
                width: 400,
                height: 600,
        columns: columnsrs,
        sm:  selectorrs
       });

var myWinalfars = new Ext.Window({ 
                        id     : capa,
                        height : 400,
                        width  : 500,
                        closeAction: "close",  // hide esto evita un error 
al abrir por segunda vez la ventana "me.dom error"
                        resizable: true,
                        items  : [gridPanelrs]// los corchetes tiene que 
estar porque si no, no salen los datos
                }); 
 
           myWinalfars.show();




Best regards,
Jose Carlos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120808/4b538319/attachment.htm 


More information about the Users mailing list