?? xml-form.js
字號:
/*
* Ext JS Library 1.1.1
* Copyright(c) 2006-2007, Ext JS, LLC.
* licensing@extjs.com
*
* http://www.extjs.com/license
*/
Ext.onReady(function(){
Ext.QuickTips.init();
// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'under';
var fs = new Ext.form.Form({
labelAlign: 'center',
labelWidth: 110,
url:'info_save.jsp',
waitMsgTarget: 'box-bd'
});
fs.fieldset(
{legend:'添加相關信息'},
new Ext.form.ComboBox({
fieldLabel: '選擇發布版塊:',
hiddenName:'Board',
store: new Ext.data.SimpleStore({
fields: ['abbr', 'Board'],
data : Ext.exampledata.states // from states.js
}),
valueField:'abbr',
displayField:'Board',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'請填寫或選擇發布版塊',
selectOnFocus:true,
blankText:'請填寫或選擇發布版塊!',
width:190
}),
new Ext.form.DateField({
fieldLabel: '選擇發布日期:',
name: 'IssuanceDate',
width:190,
format:'Y-m-d',
blankText:'發布日期不能為空!',
//value:'2007-4-9',
allowBlank:false
}),
new Ext.form.TextField({
fieldLabel: '鏈接地址名稱:',
name: 'LinkName',
allowBlank:false,
blankText:'鏈接地址名不能為空!',
width:205
}),
new Ext.form.TextField({
fieldLabel: '完整鏈接地址:',
allowBlank:false,
name:'Url',
blankText:'鏈接地址不能為空!',
vtype:'url',
width:205
}),
new Ext.form.TextArea({
fieldLabel: '相關鏈接備注:',
name: 'Memo',
width:205
})
);
// simple button add
fs.addButton('保存', function(){
//fs.addKeyListener(27, fs.hide, fs);
if(fs.isValid()){
fs.submit({
method:'POST',clientValidation:true,
waitMsg:'Loading....'
});
Ext.MessageBox.alert('狀態','數據保存成功!',function(){location.href('infomanager.jsp');});
//window.location.href('infomanager.jsp');
}
});
// explicit add
fs.addButton('重置', function(){
fs.reset();
});
fs.render('form-ct');
});
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -