Extjs 4.07 表单combo的使用

前台js脚本
/**
 * 创建分类标准添加面板
 * @returns
 */
function createStandardAddPanel(){
	//创建数据模型
	Ext.regModel('codeInfo',{
		fields:[{name:'code'}]
	});
	//定义组合框中显示的数据
	var typeStore=Ext.create('Ext.data.Store',{
		model:'codeInfo',
		proxy:{
			type:'ajax',
			url:'TypeServlet?type=combo',
			autoLoad: true,
			reader:new Ext.data.JsonReader({model:'codeInfo'})
		}
	});
	return new Ext.form.Panel({   
		id:'typeStandardAdd',
		title:'添加分类标准',   
        bodyStyle:'padding:0 0 0 0 ',//表单边距   
        frame:true, 
        width : document.body.clientWidth - 300,
        height:'100%',
        items:[{
            fieldLabel : '请输入标准标识',
            id : 'standardId',
            name:'standardId',
            height:'30',
            xtype : 'textfield',
            emptyText : '请填写标准标识',
            allowBlank : false
         },{
             fieldLabel : '请选择分类代码',
             id : 'comboTypeName',
             name:'comboTypeName',
             height:'30',
             xtype : 'combo',
             listConfig:{
            	 loadingText:'正在加载分类代码',//加载数据时显示的提示信息
            	 emptyText:'未找到匹配值',//当值不在列表时的提示信息
            	 maxHeight:60//设置下拉列表的最大高度为60像素
             },
             allQuery:'allType',//查询全部信息的查询字符串
             minChars:2,//下拉列表框自动选择前用户需要输入的最小字符数量
             queryDelay:300,//查询延迟时间
             queryParam:'searchType',//查询名字
             triggerAction:'all',//单击触发按纽显示全部数据
             store:typeStore,//设置数据源
             displayField:'code',//定义显示字段
             displayValue:'code',//定义值字段
             queryMode:'remote',//远程模式
             typeAhead: true  
          },{
             fieldLabel : '请输入分类名称',
             id : 'standardName',
             name:'standardName',
             height:'30',
             xtype : 'textfield',
             emptyText : '请填写分类名称',
             allowBlank : false
          }],
	 buttons : [{
         text : '确定',
         handler : function() { 
        	 addTypeStandard();
         }
     }, {
         text : '重置',
         handler : function() {                            
         }
     } ]
    }); 
}
后台java输出json形式
{"id":9,"code":"JTKC"},{"id":10,"code":"ss"}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值