ext combox 如果想实现类似于 baidu 搜索时的提示功能。必须禁止其分页功能才可以。
注意3点:
别设置 PageSize 属性
mode属性设置为local 本地模式
最后要手动将用到的stroe进行load操作. stroe.load(),配置autoLoad :true 也可以
//加载产品类型
var store2= new Ext.data.Store({
autoLoad :true,
proxy: new Ext.data.HttpProxy({url:"ptype.action"}),
reader: new Ext.data.JsonReader({
root : 'ptypeList'
},new Ext.data.Record.create([
{name: "tid",mapping:'id'},
{name: "tname",mapping:'name'}
]))
});
//加载生产厂商
var combox = new Ext.form.ComboBox({
fieldLabel : '产品类型',
width:(window.screen.width-320)*0.18,
//allQuery:'alltype',//查询全部信息的查询字符串
triggerAction: 'all',//单击触发按钮显示全部数据
//autoSelect : true,
//editable : false,//禁止编辑
editable : true,
loadingText : '正在加载产品类型信息',//加载数据时显示的提示信息
displayField:'tname',//定义要显示的字段
valueField:'tid' ,//定义值的字段
emptyText :'请选择产品类型',
mode: 'local',//本地模式
allowBlank : false,
id : 'ptypeid',
store : store2
//pageSize : 3 //设置此属性能进行分页,本模块不需要
});