📄 dynamic.js.svn-base
字号:
Ext.onReady(function(){ Ext.QuickTips.init(); // turn on validation errors beside the field globally Ext.form.Field.prototype.msgTarget = 'side'; var bd = Ext.getBody(); bd.createChild({tag: 'h2', html: 'Form 1 - Very Simple'}); var simple = new Ext.form.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden url:'save-form.php', frame:true, title: 'Simple Form', bodyStyle:'padding:5px 5px 0', width: 350, defaults: {width: 230}, defaultType: 'textfield', items: [{ id : 'FName',
fieldLabel: 'First Name', name: 'first', allowBlank:false },{
id:'LName', fieldLabel: 'Last Name', name: 'last' },{ id:'Company',
fieldLabel: 'Company', name: 'company' }, {
id:'Email', fieldLabel: 'Email', name: 'email', vtype:'email' }, new Ext.form.TimeField({
id:'Time', fieldLabel: 'Time', name: 'time', minValue: '8:00am', maxValue: '6:00pm' }) ], buttons: [
{text: 'Save', handler : Save},
{text: 'Cancel'}
] }); simple.render(document.body);});
function Save(){
// alert(Ext.getCmp('FName').getValue());
Ext.Ajax.request({
url : '/struts2sample/TestSave_save.action',// 请求路径,可以是任何形式
params : {
'firstname':Ext.getCmp('FName').getValue(),
'lastname':Ext.getCmp('LName').getValue(),
'company':Ext.getCmp('Company').getValue(),
'email':Ext.getCmp('Email').getValue(),
'time': Ext.getCmp('Time').getValue()
}
})
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -