ext FormPanel 생성

3120 단어
function addZxOffice(){
	initZxOfficeFormAdd();
	zxOfficeWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:700,
		height:500,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:' ',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:zxOfficeFormAdd,
		buttons:[{
			text:' ',
			itemId:'save',
			handler:function(button){
				submitForm(zxOfficeFormAdd,'../zxOfficeController/addZxOffice',grid,zxOfficeWinAdd,false,true);
			}
		},{
			text:' ',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	zxOfficeWinAdd.show();
	
}
function initZxOfficeFormAdd(){
	zxOfficeFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		/** **/
		scrollable:true,
		scrollable:'x',
		scrollable:'y',
		/** **/
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'left',
			flex:1,
			margin:'2 5 4 5'
		},
		items:[
         {
	       fieldLabel:' ',
	       xtype:'treepicker',
			displayField:'text',
			anchor:'60%',
			hiddenName:'classify_id',
			name:'classify_id',
			minPickerHeight:200,
			maxHeight:200,
			editable:false,
			allowBlank:false,
			store:Ext.create('Ext.data.TreeStore',{
				fields:['id','text'],
				root:{
					text:' ',
					id:'0',
					expanded:false
				},
				proxy:{
					type:'ajax',
					url:'../zxOfficeClassifyController/getZxOfficeClassifyTree',
					reader:{
						type:'json'
					}
				}
			})
        },
		
		{
			fieldLabel:' ',
			xtype:'textfield',
			name:'name',
			maxLength:100,
			anchor:'60%'
		},
		{
			fieldLabel:' ',
			xtype:'textfield',
			name:'num',
			maxLength:100,
			anchor:'60%'
		},
		{
			fieldLabel:' ID',
			hidden:true,
			xtype:'textfield',
			name:'classify_id',
			maxLength:32,
			anchor:'60%'
		},
		{
			fieldLabel:' , ',
			xtype:'textfield',
			name:'unit',
			maxLength:10,
			anchor:'60%'
		},
		{
			fieldLabel:' ',
			xtype:'combo',
			emptyText:' ',
			store:zx_office_delete,
			mode:'local',
			triggerAction:'all',
			editable:false,
			allowBlank:false,
			hiddenName:'status',
			valueField:'value',
			displayField:'text',
			name:'status',
			maxLength:2,
			anchor:'60%'
		},
		/*{
			fieldLabel:' ',
			xtype:'datetimefield',
			format:'Y-m-d H:i:s',
			name:'create_date',
			maxLength:19,
			anchor:'100%'
		},*/
		{
			fieldLabel:' ',
			xtype:'textfield',
			name:'standard',
			maxLength:255,
			anchor:'60%'
		}
		]
	});

좋은 웹페이지 즐겨찾기