<!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.18407" 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>Here's an easier way:</FONT></DIV>
<DIV><FONT face=Arial size=2>assume store2 is configured for layer2</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>gridPanel.reconfigure(store2,gridPanel.fields)</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=rykovd@gmail.com
href="mailto:rykovd@gmail.com">Denis Rykov</A> </DIV>
<DIV><B>Sent:</B> Friday, May 27, 2011 9:47 AM</DIV>
<DIV><B>To:</B> <A title=mpriour@kestrelcomputer.com
href="mailto:mpriour@kestrelcomputer.com">Matt Priour</A> </DIV>
<DIV><B>Cc:</B> <A title=Users@geoext.org
href="mailto:Users@geoext.org">Users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> Re: [Users] FeatureStore unbinding</DIV></DIV></DIV>
<DIV><BR></DIV>Matt, thanks for full answer!<BR>A little workaround for my
problem, maybe useful for
anyone:<BR><BR>store.unbind();<BR>store.removeAll();<BR>store.bind(layer2);<BR>gridPanel.getSelectionModel().unbind();<BR>gridPanel.getSelectionModel().bind(layer2);<BR><BR>
<DIV class=gmail_quote>On Fri, May 27, 2011 at 8:22 PM, Matt Priour <SPAN
dir=ltr><<A
href="mailto:mpriour@kestrelcomputer.com">mpriour@kestrelcomputer.com</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"
name="Compose message area">
<DIV><FONT face=Arial size=2>There may or may not be a way to unbind/rebind a
layer to a feature store. However, the unbind/bind functions are internal
functions that register and unregister event listeners.</FONT></DIV>
<DIV><FONT face=Arial size=2>However, the GeoExt pattern of doing things
really expects a single layer to feature store relation. Doing otherwise is
going to cause you to jump through many more hoops and monkey patch various
bits of code.</FONT></DIV>
<DIV><FONT face=Arial size=2>Grids and data views have methods to reconfigure
the view with a new store, field definitions, or both. Any visualization you
would be using a feature store with will able to handle switching the store
much easier than changing the layer attached to the store.</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><B>From:</B> <A title=rykovd@gmail.com href="mailto:rykovd@gmail.com"
target=_blank>Denis Rykov</A> </DIV>
<DIV><B>Sent:</B> Friday, May 27, 2011 5:48 AM</DIV>
<DIV><B>To:</B> <A title=Users@geoext.org href="mailto:Users@geoext.org"
target=_blank>Users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> [Users] FeatureStore unbinding</DIV></DIV></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV><BR></DIV>Hi!
<DIV><BR></DIV>
<DIV>Please help me with the following problem. Little testcase:</DIV>
<DIV><BR></DIV>
<DIV>1) There are two layers on map (e.g., layer1 and layer2);</DIV>
<DIV>2) FeatureStore (store) binded to layer1;</DIV>
<DIV>3) After loading map try to perform: </DIV>
<DIV>store.unbind()</DIV>
<DIV>store.bind(layer2)</DIV>
<DIV><BR></DIV>
<DIV>Features of both layers takes layer2 style! Is it bug?</DIV>
<DIV><BR></DIV>
<DIV>What is the right way to unbin store from one layer and bind it to
another?</DIV>
<DIV>Big thanks.</DIV></DIV></DIV>
<P></P>
<HR>
<P></P>_______________________________________________<BR>Users mailing
list<BR><A href="mailto:Users@geoext.org"
target=_blank>Users@geoext.org</A><BR><A
href="http://www.geoext.org/cgi-bin/mailman/listinfo/users"
target=_blank>http://www.geoext.org/cgi-bin/mailman/listinfo/users</A><BR>
<P></P></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>