[Users] Two different stores for the same GridPanel

gbrun gbrun at myopera.com
Fri Jun 24 15:27:40 CEST 2011


I think I understood what you mean. The thing is that I don't know how  
create a store source indicator!

I will also remember that, like you said, after the stores would be  
configured, I will have to create two separate functions to display  
correctly both layer types!

Maybe you can set me straight about the store source indicator?

Geoffrey


On Fri, 24 Jun 2011 13:38:48 +0200, Matt Priour  
<mpriour at kestrelcomputer.com> wrote:

> You can not use 2 different stores at the same time for a grid.
> You can combine the stores together or switch between different stores  
> and/or column models
> For your use I would create a new store with the common fields that I  
> needed for WMS/WFS layers plus a data store source indicator and use  
> that for the grid.
> Then instead of your current Add To Map button handler function, I would  
> modify that to handle both types of layers and modify/add them to the  
> map accordingly.
>
> Matt Priour
> Kestrel Computer Consulting
>
>
> From: gbrun
> Sent: Friday, June 24, 2011 4:20 AM
> To: users at geoext.org
> Subject: [Users] Two different stores for the same GridPanel
>
>
> Hi everybody!
>
> I'm trying to populate an GridPanel with a WMSCapabilitiesStore and a
> WFSCapabilitiesStore. My problem is that I don't know how to specify two
> different stores for the same grid. It works when I work with two  
> separate
> grids, but not with only one grid.
>
> Here is a sample of my current code:
>
> //WMS definition catalog
> var store_WMS = new GeoExt.data.WMSCapabilitiesStore({
> url:
> "/geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities&namespace=parc",
> protocolOptions: {version: "1.1.0"},
> autoLoad: true
> });
>
> //WFS definition catalog
> var store_WFS = new GeoExt.data.WFSCapabilitiesStore({
> url:
> "/geoserver/ows?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&namespace=parc",
> protocolOptions: {version: "1.1.0"},
> autoLoad: true
> });
>
> //Grid definition for WMS
>          var grid_WMS = new Ext.grid.GridPanel({
>                  title: "Couches disponibles",
> anchor: '100% 50%',
>                  store: store_WMS,
> collapsible: true,
> collapsed: false,
> titleCollapse: true,
> autoScroll: true,
> split: true,
>                  columns: [
>                      {header: "Name", dataIndex: "name", sortable: true},
>                      {header: "Title", dataIndex: "title", sortable:  
> true}
>                  ],
> bbar: ['->',{
> text: "Add to map",
> handler: function() {
> grid_WMS.getSelectionModel().each(function(record) {
> var clone = record.clone();
> clone.get("layer").mergeNewParams({
> format: "image/png",
> transparent: true
> });
> mapPanel.layers.add(clone);
> });
> }
> }]
>           });
>
>
> Does everyone have an idea?
>
> Geoffrey
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Users mailing list