<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 10pt">
<DIV>You’re going to want to use an ArrayStore for that “COUNTRY” combo box, not
the feature store.</DIV>
<DIV>If you use the feature store and filter unique countries, you will also be
filtering the grid.</DIV>
<DIV>Provide the array returned by the ‘collect’ method (<A
title=http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-collect
href="http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-collect">http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-collect</A>)
on the feature store to the ArrayStore’s loadData function.</DIV>
<DIV>Put a listener on the combo box for the ‘select’ event that uses the
selected value to filter the feature store is you want to limit feature records
by that value.</DIV>
<DIV>If you are just looking to do linked combos, and not do any filtering or
only filter after the user has made a series selections from linked combos, then
you should have the ‘select’ listener for the first combo box ‘query’ (<A
title=http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-query
href="http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-query">http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-query</A>)
the feature store and either directly use the returned collection in the linked
child combo box(es) or further process the collection to unique values for a
simple array store backed combo box</DIV>
<DIV> </DIV>
<DIV>Matt Priour</DIV>
<DIV> </DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A
title=jorgelopez.physics@gmail.com
href="mailto:jorgelopez.physics@gmail.com">Jorge Lopez</A> </DIV>
<DIV><B>Sent:</B> Wednesday, November 02, 2011 5:22 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] Load combo, FeatureStore and filter
values</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<P class=MsoNormal>Hello everyone: </P>
<P class=MsoNormal> </P>
<P class=MsoNormal><SPAN lang=EN-GB>I am driving mad with this problem. I am
doing a web application with OpenLayers, ExtJs and GeoExt and the simple fact to
load values in a combo have become hard. </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB>Step1: I have defined a featurestore that
stores the records from a layer in Geoserver. No problem to load these items in
a GeoExt gridPanel. This store has been generated with this code:</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB>----</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB>store = new
GeoExt.data.FeatureStore({</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
layer: wfslayer,</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
fields: [</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
{name: 'PLANT', type: 'string'},</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
{name: ‘COUNTRY’, type: ‘string’},</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
{name: ‘STATUS', type: 'string'},</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
{name: 'long', type:
'float'},
</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
{name: 'lat', type: 'float'},</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
],</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
proxy: new GeoExt.data.ProtocolProxy({</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
protocol: new OpenLayers.Protocol.WFS({</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
//version: "1.0.0",</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
srsName: 'EPSG:900913', </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
url: "<A
href="http://localhost:8080/geoserver/wfs">http://localhost:8080/geoserver/wfs</A>",</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
featureNS: '<A
href="http://localhost:8080/wfs">http://localhost:8080/wfs</A>',</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
featurePrefix: nomPrefix,</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
featureType: nomLayer,</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
geometryName: nomGeometry,</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
schema: <A
href="http://localhost:8080/geoserver/wfs?service=WFS&request=DescribeFeatureType&typename=lonlat22">http://localhost:8080/geoserver/wfs?service=WFS&request=DescribeFeatureType&typename=lonlat22</A>"</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
})</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
}), </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
autoLoad: true</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
});</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB>--</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB>This store has records with fields (COUNTRY)
that contains repeated values and I would like to filter that store by this
field: COUNTRY. For that, I have created a ComboBox and I am trying to show only
“no repeated” values but no success. </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB>var combo1=new Ext.form.ComboBox({
</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
fieldLabel:'Filtro Pais', </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
name:'cmb-P', </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
forceSelection: true, </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
store: store, </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
emptyText:'Escoge un país', </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
triggerAction: 'all', </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
//allQuery: 'DISTINCT',</SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
editable:false, </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
displayField:'COUNTRY', </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
valueField: 'COUNTRY' </SPAN></P>
<P class=MsoNormal><SPAN
lang=EN-GB>
}); </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB>This combo shows a list of all (repeated)
values from store. This a question of ExtJS forum but I would appreciate if
anyone knew how to filter it out. </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB>Once a country is selected from combo, I
would like to be shown the STATUS associated to that selected COUNTRY. This is a
question of anidated combos but I don’t know how to ‘featurefilter’ config tag
would be entered in this problem. </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB>Any ideas? </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB>Thanks in advanced</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB>Jorge</SPAN></P>
<P>
<HR>
_______________________________________________<BR>Users mailing
list<BR>Users@geoext.org<BR>http://www.geoext.org/cgi-bin/mailman/listinfo/users<BR></DIV></DIV></DIV></BODY></HTML>