【发布时间】:2011-11-25 08:48:42
【问题描述】:
嗨,我有一个带有远程组合框的表单面板,商店是 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);
}
}
}
},
商店就在这里:
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']
});
谢谢
【问题讨论】:
标签: javascript asp.net autocomplete combobox extjs3