Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ExtJs组合框问题_Javascript_Asp.net_Autocomplete_Combobox_Extjs3 - Fatal编程技术网

Javascript ExtJs组合框问题

Javascript ExtJs组合框问题,javascript,asp.net,autocomplete,combobox,extjs3,Javascript,Asp.net,Autocomplete,Combobox,Extjs3,您好,我有一个带有远程combobox的formpanel,存储区是jsonstore,是从Web服务获得的,有分页结果,一切都很好,但是当您从组合中选择一个选项时,您可以选择第三个,但组合选择第一个选项我不知道原因组合的配置如下: { xtype: 'combo', fieldLabel: 'Sitio Interés', an

您好,我有一个带有远程combobox的formpanel,存储区是jsonstore,是从Web服务获得的,有分页结果,一切都很好,但是当您从组合中选择一个选项时,您可以选择第三个,但组合选择第一个选项我不知道原因组合的配置如下:

{
                            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.getKey() == e.ENTER) {
                                        Ext.getCmp('btnConsultar').handler.call(Ext.getCmp('btnConsultar').scope);
                                    }
                                }
                            }
                        },

谢谢

您的商店配置有点不正确。它应该是
idProperty
,而不是
id
。还要检查来自服务器的
json
。确保
id
是唯一的

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']
        });