MyForm = Ext.extend(Ext.FormPanel,{
Code:null, //接口编码
constructor:function(url){ ///把url作为参数传进来
this.Code = new Ext.form.TextField({
fieldLabel: "编码",
xtype: 'textfield',
anchor: '90%',
allowBlank:false,
});
IntfInfoForm.superclass.constructor.call(this,{
height:90,
labelWidth: 40,
labelAlign: 'left',
frame: true,
url:url,/////使用参数赋值
bodyStyle:"padding: 15px 5px 0",
layout: 'form',
items:[this.Code]
});
}
});
在其他地方使用上面的Form:
如果是添加:url="执行插入sql的方法地址";
如果是添加:url="执行更新sql的方法地址";
var form=new MyForm(url)////初始化form的时候传url就可以了