天天看點

extjs textField之後添加一個button以及背景資料互動

var pnRow1=new Ext.Panel({
		border:false,
		layout:'column',
		items:[
				new Ext.Panel({
				columnWidth:.2,
				layout:'form',
				border:false,
				labelWidth:100,
				labelAlign:'left',
				items:[
					{
					   xtype : "textfield",
			         id:"contract_id",
				      name:"contract_id",
				      maxLength :20,
				      value:'${model.contract_id}',
		             fieldLabel : "合同辨別",
		             width : 150
					}
				]
				}),
				//
				new Ext.Panel({
				columnWidth:.1,
				layout:'form',
				border:false,
				labelWidth:100,
				labelAlign:'right',
				items:[{
				text: '擷取',
					id:'selectDuty2',
					xtype: 'button',
					handler : function() {
					
					Ext.Ajax.request({
								url: 'contractAction!getContract_id.shtml',
								method: 'POST',
								params: {},
								success: function (result, request){
								Ext.getCmp('contract_id').setValue(result.responseText);
									//alert( result.responseText+"-----"+request["id"]);
								},
								failure: function (result, request){
					            }
							});
					}}
				]
				}), 
				//
				new Ext.Panel({
				columnWidth:.3,
				layout:'form',
				border:false,
				labelWidth:100,
				labelAlign:'right',
				items:[
				comboInspaction_authority2
				]
				}), 
				//
				new Ext.Panel({
				columnWidth:.3,
				layout:'form',
				border:false,
				labelWidth:100,
				labelAlign:'right',
				items:[
				comboInspection_type2
				]
				})
			 
		]
		});
           
extjs textField之後添加一個button以及背景資料互動