[Users] select value of a combobox

Pierre Giraud pierre.giraud at camptocamp.com
Fri May 28 16:16:24 CEST 2010


medicago_box.getValue() should give you what you want.

2010/5/28 François Boussuges <f.boussuges at gmail.com>:
> Hello
>
> I have a WFS point and I display style okf this layers in function of
> diffferent attributes.
> For display the style in function of my differents attributs I have
> create a combobox:
>
> var medicago_store = new Ext.data.SimpleStore({
>        fields:['value','text'],
>        data: [
>               ['SPIRALE_GOUSSE_HORAIRE', '% de spirale horaire'],
>               ['SPIRALE_GOUSSE_ANTIHORAIRE', '% de spirale antihoraire']
>               ]});
>    var medicago_box = new Ext.form.ComboBox({
>        store: medicago_store,
>        displayField:'text',
>        valueField: 'value',
>        region: 'center',
>        emptyText:'Selectionner une variable...',
>        typeAhead: true,
>        selectOnFocus:true,
>        mode: 'local',
>        width: 200,
>
>        triggerAction: 'all'
>
> I want to get the select value of the combobox for use this in a context
> variable like this:
>
> var context = {
>
>    fillColor: function(feature) {
>        if(feature.cluster) {
>        if ('/combobox.selectedvalue()' = 'value1/'){
>            sens_hor= parseFloat(0)
>            for(var c = 0; c < feature.cluster.length; c++)
>
> sens_hor=sens_hor+parseFloat(feature.cluster[c].attributes.SPIRALE_GOUSSE_HORAIRE)
>            result=sens_hor/feature.cluster.length
>            if(result > 50) return "#990000";
>            if(result<=50) return "#000099";}
>
> But I have tried to extract the select value (or text ) of the combobox
> with no results?
> Have you an ideas to insert this value in my function?
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>



-- 
Pierre GIRAUD
Géomaticien, Analyste

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 93
Mail : pierre.giraud at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list