Thanks Matt for your advice. <div><br></div><div>Anyway I didn`t succeed it. As you comment, first I should create an array by using 'collect' method on combo's store. I got it by using an easy example of an arraystore (static) but in my example, with data provided by an web service, when I use collect method like this: </div>
<div><br></div><div><br></div><div><div>var combo1=new Ext.form.ComboBox({ </div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>fieldLabel:'Filtro Pais', </div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>name:'cmb-P', </div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>forceSelection: true, </div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>store: store2.collect('COUNTRY'), //store2 is my combo's store </div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>mode: 'local',<span class="Apple-tab-span" style="white-space: pre; ">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>emptyText:'Select a country', </div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>triggerAction: 'all',</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>//allQuery: 'DISTINCT',</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>editable:false, </div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>displayField:'COUNTRY', </div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>valueField: 'COUNTRY'</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span><span class="Apple-tab-span" style="white-space: pre; ">                </span>}); </div>
<div><br></div><div>Nothing is appeared. I think that store is not loaded, so nothing can happen but why I got it if collect is not used?</div><div><br></div><div>I can figure out what is happening.</div><div><br></div><div>
Jorge</div><div><br></div><br><div class="gmail_quote">On Wed, Nov 2, 2011 at 3:38 PM, Matt Priour <span dir="ltr"><<a href="mailto:mpriour@kestrelcomputer.com">mpriour@kestrelcomputer.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div 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" target="_blank">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" target="_blank">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><b>From:</b> <a title="jorgelopez.physics@gmail.com" href="mailto:jorgelopez.physics@gmail.com" target="_blank">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" target="_blank">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"><div><div></div><div class="h5">
<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" target="_blank">http://localhost:8080/geoserver/wfs</a>",</span></p>
<p class="MsoNormal"><span lang="EN-GB">
featureNS: '<a href="http://localhost:8080/wfs" target="_blank">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" target="_blank">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>
</div></div><p>
</p><hr>
_______________________________________________<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></div></div></div>
</blockquote></div><br></div>