日期:2014-05-16 浏览次数:20414 次
function rolePermitInfoFn(){
var permits = new Array(); //定义一个数组
var permitForm = new Ext.FormPanel({
id:"permitForm",
width:340,
height:130,
frame:true,
labelAlign:"right",
baseParams:{permits:permits},
monitorValid:true,
items:[{
xtype:'checkboxgroup',
name:'FileItype',
fieldLabel:'权限',
columns:3,//3列
items:[
{boxLabel:'查询',name:'query',inputValue:"201"},
{boxLabel:'添加',name:'add',inputValue:"202"},
{boxLabel:'删除',name:'delete',inputValue:"205"},
{boxLabel:'更新',name:'edit',inputValue:"203"},
{boxLabel:'导出数据',name:'export',inputValue:"206"}
]
}],
buttons:[
{text:"确定",formBind:true,handler:function(){
var FileItype=permitForm.getForm().findField('FileItype').getValue(); //得到组合框
for(var i=0; i<FileItype.length; i++){
permits[i] = FileItype[i].inputValue; //遍历组合到数组中
alert(permits[i]);//????????????????????????????
}
permitForm.getForm().submit({
url:"RoleInfo!rolePermits.action",
waitMsg:"请稍等,正在进行保存!",
success:function(form, action){
Ext.MessageBox.alert("保存成功",action.result.msg,function(){
Ext.MessageBox.confirm("提示框", "是否继续添加?", function(btn) {
if (btn == "yes") {
permitForm.form.reset();
}else{
permitWindow.close();
}
})
});
store.reload();
},
failure:function(form, action){
Ext.MessageBox.alert("保存失败",action.result.msg);
}
});
}},
{text:"重置",handler:function(){
permitForm.form.reset();
}}
]
});
var permitWindow =&nb