关于Ext3.4中combobox的问题。大侠们进来看看喽

lengkaixiaodao 2011-11-04 04:20:21
我这需要这个功能,类似搜索引擎那样,从输入框输入内容然后自动读取符号要求的信息出来显示,我看了Ext3.4官方例子中有类似的功能,但是有个问题没有解决掉。呈现过程:输入内容选择combobox中的一条内容,单击查询按钮,进行了一次查询,结果正确,然后将combobox中的内容给删除,单击查询按钮,如果正常的话应该相当于默认全部查询,可是删除后查询还是保留的上次的结果,也就是combobox中的valueField值没有清空。 我使用这中取值方式this.simStore.getValue();

var simStore = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : 'base/abc.action,
method : 'post'
}),
baseParams : {
limit : globalValue_pageSize
},
reader : new Ext.data.JsonReader({
root : 'root',
totalProperty : 'total',
successProperty : 'success'
}, [{
name : 'id'
} ,{
name : 'faceCd'
} ,{
name : 'faceName'
} ,{
name : 'faceSimp'
}
])
});
// Custom rendering Template 格式显示名称
var resultTpl = new Ext.XTemplate(
'<tpl for="."><div class="search-item">',
'<h3>{faceName}</h3>',
'</div></tpl>'
);
resultTpl.compile();
this.faceSimp = new Ext.form.ComboBox({
fieldLabel : '简拼',
minChars:0,
name : 'faceSimp',
hiddenName:'faceSimp',
store: simStore,
displayField:'faceName',
valueField:'id',
typeAhead: false,
loadingText: 'Searching...',
pageSize:10,
hideTrigger:true,
tpl: resultTpl,
itemSelector: 'div.search-item'
});


...全文
110 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
大哥-你真棒 2011-11-04
  • 打赏
  • 举报
回复

///别取store里的值啊,取combox的值

87,989

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧