function cForm()
{
///------------------------資料來源
var arr=[ [1, '本.拉登'], [2, '笨.拉登'],[3, '笨.拉燈'],[6, '笨.1'],[7, '笨.2'],[8, '笨.3'],[4,'無敵了'],[5,'無人了'] ];
var reader = new Ext.data.ArrayReader(
{id: 0},
[
{name: 'value'},
{name: 'key'}
]);
var store=new Ext.data.Store({
reader:reader
});
store.loadData(arr);
//--------------------------
//測試面板
var xform = new Ext.form.FormPanel({
///applyTo:"MXT",
///基本樣式
baseCls: 'x-plain',
///布局凡是
layout:'absolute',
///提交的資料
url:'save-form.php',
//閉合時的效果
animCollapse:true,
///預設的 輸入類型
defaultType: 'textfield',
items: [{
x: 0,
y: 5,
xtype:'label',
text: '測試中...:'
},{
///是否允許為空白
allowBlank: false,
//驗證的提示文字內容
blankText:'驗證的提示內容,不可為空',
x: 60,
y: 0,
name: 'to',
fieldLabel:'text',
maskRe:/[a-zA-z]/gi,
anchor:'50%' // anchor width by percentage
},
///CLASS
{
x: 300,
y: 0,
name: 'tozcxv',
anchor:'100%' // anchor width by percentage
},
{
x: 0,
y: 35,
xtype:'label',
text: '測試中:'
},{
x: 60,
y: 30,
//maskRe:'/[a-zA-z]/gi',
name: '開始中',
anchor: '100%' // anchor width by percentage
},{
x:0,
y: 60,
xtype: 'textarea',
name: 'msg',
anchor: '100% 40%' // anchor width and height
},
///時間按鈕
{
x:0,
y:200,
xtype: 'datefield',
name: 'msgzcx',
anchor: '50% 100%' // anchor width and height
},
// ///時間
{
x:240,
y:200,
xtype: 'timefield',
name: 'msgzcxdt',
///時間的遞增
increment:10,
///驗證失敗的文字提示
invalidText:'時間格式不正確',
anchor: '50% 100%' // anchor width and height
},
///下拉選項框
{
x:0,
y:230,
xtype: 'combo',
///定義具體的類型 select ComboBox
fieldLabel:'ComboBox',
///是否可編輯 true ComboBox false select
editable:true,
//至少幾個字時開始檢索並顯示檢索結果 注意衝突
minChars:2,
///每頁顯示的大小
pageSize:3,
///值不存在時的顯示
valueNotFoundText:'無此選項',
///顯示的欄位
displayField:'key',
///資料類型類型 本地
mode: 'local',
///資料來源
store:store
},
{
x:0,
y: 260,
xtype: 'numberfield',
name: 'msgzcx',
anchor: '100% 100%' // anchor width and height
},
//數字
{
x:0,
y: 300,
xtype: 'numberfield',
name: 'msgzcx',
anchor: '100% 100%' // anchor width and height
}
],
buttons: [{
text: '登陸',
type: 'submit',
//定義表單提交事件
handler:function(){
///提交表單
xform.getForm().submit({
url:'Operator.aspx?Action=1SAVE',
method:'post',
success:function(form,action){
alert('adsf');
},
//提交失敗的回呼函數
failure:function(){
alert('失敗');
}
});
//提交成功的回呼函數
//alert(xform.getForm());
}
}]
});
var window = new Ext.Window({
///標題
title: '操作人員管理',
///寬
width: 500,
///高
height:500,
///最小的寬頻
minWidth: 300,
///最小的高度
minHeight: 200,
///布局的方式
layout: 'fit',
///是否允許調整大小
resizable:false,
///是否准許拖動
draggable:true,
///關閉按鈕
closable:true,
///是否視圖中顯示
constrain:true,
///是否為透明背景
plain:true,
///顯示最小化按鈕
minimizable:true,
///最大化按鈕
maximizable:true,
///是否顯示收縮按鈕
expandOnShow:true,
///是否顯示關閉按鈕
closable:false,
///關閉按鈕樣式
collapsedCls:"x-plain",
///不可用時 是否進行遮擋
maskDisabled:true,
///頭部文本
headerAsText:"頭部標題",
///表
bodyStyle:'padding:5px;',
///按鈕的對其方式
buttonAlign:'center',
items: xform,
buttons: [{
text: '關閉'
},{
text: '取消'
}]
});
window.show();