ext combox 下拉框不出现自动提示,自动选中的解决方法
程序员文章站
2022-03-07 11:19:54
看代码 复制代码 代码如下: var comboxcontracttype = new ext.form.combobox({ name:'logisticsid', fi...
看代码
var comboxcontracttype = new ext.form.combobox({
name:'logisticsid',
fieldlabel:'物流公司',
displayfield:'logisticsname',
valuefield:'logisticsid',
emptytext:'请选择',
width:330,
editable:true,
allowblank:false,
mode:'local',
loadingtext:'loading...',
hiddenname:'logisticsid',
//pagesize:10,
selectonfocus: true,
triggeraction:'all',
store:comboxcontracttypestore = new ext.data.jsonstore({
url:'/pcms/dictionary/logistics.do?method=findlogistics',
root:'datas',
totalproperty: 'totalrecords',
fields:[
{name:'logisticsid', mapping:'logisticsid'},
{name:'logisticsname', mapping:'shortname'}
]
})
});
comboxcontracttypestore.load({params:{start:0,limit:100}});
注意3点:
别设置 pagesize 属性
mode属性设置为local 本地模式
最后要手动将用到的stroe进行load操作. stroe.load();
复制代码 代码如下:
var comboxcontracttype = new ext.form.combobox({
name:'logisticsid',
fieldlabel:'物流公司',
displayfield:'logisticsname',
valuefield:'logisticsid',
emptytext:'请选择',
width:330,
editable:true,
allowblank:false,
mode:'local',
loadingtext:'loading...',
hiddenname:'logisticsid',
//pagesize:10,
selectonfocus: true,
triggeraction:'all',
store:comboxcontracttypestore = new ext.data.jsonstore({
url:'/pcms/dictionary/logistics.do?method=findlogistics',
root:'datas',
totalproperty: 'totalrecords',
fields:[
{name:'logisticsid', mapping:'logisticsid'},
{name:'logisticsname', mapping:'shortname'}
]
})
});
comboxcontracttypestore.load({params:{start:0,limit:100}});
注意3点:
别设置 pagesize 属性
mode属性设置为local 本地模式
最后要手动将用到的stroe进行load操作. stroe.load();
上一篇: extjs两个tbar问题探讨
下一篇: ExtJs 实现动态加载grid完整示例