开发者

ExtJs Combobox problem

开发者 https://www.devze.com 2023-04-07 23:21 出处:网络
Hi i have a formpanel with remote combobox, the store is jsonstore and is get from webservices with paging results, everything is well, but when you pick an option form the combo always pick the first

Hi i have a formpanel with remote combobox, the store is jsonstore and is get from webservices with paging results, everything is well, but when you pick an option form the combo always pick the first one, you can pick the third but the combo choose the first option i don't know the reason for this the configuration for the combo is this:

{
                            xtype: 'combo',
                            fieldLabel: 'Sitio Interés',
                            anchor: '100%',
                            triggerAction: 'all',
                            store: dsPuntos,
                            mode: 'remote',
                            displayField: "Nombre",
                            valueField: "Id",
                            typeAhead: false,
                            width: 222,
                            hideLabel: true,
                            allowBlank: false,
                            id: 'cboDato',
                            editable: true,
                            pageSize: 20,
                            minChars: 0,
                            hideTrigger: true,
                            //enableKeyEvents: true,
                            emptyText: 'Escriba un sitio de interés',
                            tpl: '<tpl for="."><div class="x-combo-list-item">{Nombre} - {Municipio}</div></tpl>',
                            listeners: {
                                scope: this,
                                specialkey: function (f, e) {
                                    if (e开发者_如何学JAVA.getKey() == e.ENTER) {
                                        Ext.getCmp('btnConsultar').handler.call(Ext.getCmp('btnConsultar').scope);
                                    }
                                }
                            }
                        },

and the store is here:

var dsPuntos = new Ext.data.JsonStore({
            proxy: new Ext.data.HttpProxy({
                url: 'Services/MapService.svc/GetSitiosInteres',
                method: 'GET'
            }),
            root: 'd.rows',
            totalProperty: 'd.total',
            id: 'Id',
            fields: ['Nombre', 'Municipio', 'Id']
        });

Thanks


Your store config is a little off. It should be idProperty instead of id. Also check the json coming from the server. Make sure that the id are unique.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号