1

I have this combobox configuration:

{
                width: 70,
                xtype: 'combo',
                fieldLabel: _mobile,
                displayField: 'num_mobile',
                valueField: 'id',
                id: 'ListMobileCmd',
                store: mobilesStore,
                triggerAction: 'all',
                emptyText: 'Mobiles',
                mode: 'local'
            }

ans my store is:

var mobilesStore = new GeoExt.data.FeatureStore({
        layer: MobileLayer,
        proxy: new GeoExt.data.ProtocolProxy({
                protocol: new OpenLayers.Protocol.HTTP({
                    url: SERVER+"/mobiles_personnes",
                    format: new OpenLayers.Format.GeoJSON()
                })
        }),
        autoLoad: false,
        sortInfo: { field: 'num_mobile',  direction: 'ASC'},
        fields: [{name: 'id', mapping: 'id'},
                  {name: 'num_mobile'},
                  {name: 'tm_id'},
                  {name: 'is_owner'},
                  {name: 'datetime_deb'},
                  {name: 'nom'},
                  {name: 's_id'},
                  {name: 'p_id'},
                  {name: 'cin'},
                  {name: 'login'},
                  {name: 'type'},
                  {name: 'adresse'},
                  {name: 'prenom'},
                  {name: 'num'},
                  {name: 'pwd'},
                  {name: 'datetime_fin'},
                  {name: 'num_mobile'},
                  {name: 'email'}]
    });

I got all my items in my combobox but it always displays the first item, as selected, when I select any item from the list! Any ideas?

4

1 回答 1

6

我之前遇到过相同类型的卡住:) 只需将您的值更改为“num_mobile”,它就会正常工作。

            valueField: 'num_mobile',
于 2012-10-11T07:38:03.840 回答