<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6002.18457" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" leftMargin=0
topMargin=0 CanvasTabStop="true" name="Compose message area">
<DIV><FONT face=Arial size=2>You can not use 2 different stores at the same time
for a grid.</FONT></DIV>
<DIV><FONT face=Arial size=2>You can combine the stores together or switch
between different stores and/or column models</FONT></DIV>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Matt Priour</FONT></DIV>
<DIV><FONT face=Arial size=2>Kestrel Computer Consulting</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=gbrun@myopera.com
href="mailto:gbrun@myopera.com">gbrun</A> </DIV>
<DIV><B>Sent:</B> Friday, June 24, 2011 4:20 AM</DIV>
<DIV><B>To:</B> <A title=users@geoext.org
href="mailto:users@geoext.org">users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> [Users] Two different stores for the same
GridPanel</DIV></DIV></DIV>
<DIV><BR></DIV>Hi everybody!<BR><BR>I'm trying to populate an GridPanel with a
WMSCapabilitiesStore and a <BR>WFSCapabilitiesStore. My problem is that I
don't know how to specify two <BR>different stores for the same grid. It
works when I work with two separate <BR>grids, but not with only one
grid.<BR><BR>Here is a sample of my current code:<BR><BR>//WMS definition
catalog<BR>var store_WMS = new GeoExt.data.WMSCapabilitiesStore({<BR>url:
<BR>"/geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities&namespace=parc",<BR>protocolOptions:
{version: "1.1.0"},<BR>autoLoad: true<BR>});<BR><BR>//WFS definition
catalog<BR>var store_WFS = new GeoExt.data.WFSCapabilitiesStore({<BR>url:
<BR>"/geoserver/ows?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&namespace=parc",<BR>protocolOptions:
{version: "1.1.0"},<BR>autoLoad: true<BR>});<BR><BR>//Grid definition for
WMS<BR> var grid_WMS = new
Ext.grid.GridPanel({<BR>
title: "Couches disponibles",<BR>anchor: '100%
50%',<BR>
store: store_WMS,<BR>collapsible: true,<BR>collapsed: false,<BR>titleCollapse:
true,<BR>autoScroll: true,<BR>split:
true,<BR>
columns:
[<BR>
{header: "Name", dataIndex: "name", sortable:
true},<BR>
{header: "Title", dataIndex: "title", sortable:
true}<BR>
],<BR>bbar: ['->',{<BR>text: "Add to map",<BR>handler: function()
{<BR>grid_WMS.getSelectionModel().each(function(record) {<BR>var clone =
record.clone();<BR>clone.get("layer").mergeNewParams({<BR>format:
"image/png",<BR>transparent:
true<BR>});<BR>mapPanel.layers.add(clone);<BR>});<BR>}<BR>}]<BR>
});<BR><BR><BR>Does everyone have an
idea?<BR><BR>Geoffrey<BR>_______________________________________________<BR>Users
mailing list<BR><A href="mailto:Users@geoext.org">Users@geoext.org</A><BR><A
href="http://www.geoext.org/cgi-bin/mailman/listinfo/users">http://www.geoext.org/cgi-bin/mailman/listinfo/users</A><BR></BODY></HTML>