[code="java"]
/** **************************** 菜单权限管理 ***************************** */
// 菜单权限(form)
var _addPurviewMenuForm = new Ext.FormPanel({
labelAlign : 'left',
autoHeight : true,
collapsible : true,
width : 420,
frame : true,
title : '权限信息',
bodyStyle : 'padding:5px',
items : [{
bodyStyle : 'padding:5px',
layout : 'column',
items : [{
columnWidth : .2
}, {
baseCls : 'x-plain',
columnWidth : .6,
layout : 'form',
labelWidth : 70,
items : [{
fieldLabel : '请选择用户',
xtype : 'combo',
mode : 'local',
width : 145,
triggerAction : 'all',
store : userStore,
valueField : 'id',
displayField : 'name',
emptyText : '请选择用户',
editable : false,
name : 'userinfo'
}]
}, {
columnWidth : .2
}]
}, {
xtype : 'fieldset',
title : '选择菜单',
// collapsible : true,
width : 383,
autoHeight : true,
items : [{
layout : 'column',
defaults : {
hideLabels : true,
layout : 'form'
},
items : [{
columnWidth : .01
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '首页',
name : 'no',
inputValue : 1,
checked : true,
disabled : true
})]
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '实时监测',
name : 'no',
inputValue : 2,
checked : false
})]
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '历史查询',
name : 'no',
inputValue : 3,
checked : false
})]
}, {
columnWidth : .01
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '能耗分析',
name : 'no',
inputValue : 4,
checked : false
})]
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '用能诊断',
name : 'no',
inputValue : 5,
checked : false
})]
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '事件报警',
name : 'no',
inputValue : 6,
checked : false
})]
}, {
columnWidth : .01
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '数据录入',
name : 'no',
inputValue : 7,
checked : false
})]
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '统计报表',
name : 'no',
inputValue : 8,
checked : false
})]
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '设置管理',
name : 'no',
inputValue : 9,
checked : false
})]
}, {
columnWidth : .01
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '计费系统',
name : 'no',
inputValue : 10,
checked : false
})]
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '演示系统',
name : 'no',
inputValue : 11,
checked : true,
disabled : true
})]
}, {
columnWidth : .33,
items : [new Ext.form.Checkbox({
boxLabel : '风格',
name : 'no',
inputValue : 12,
checked : true,
disabled : true
})]
}]
}]
}]
});
// 菜单权限(window)
var newPurviewMenuWin;
function handlePurviewMenuWin() {
if (!newPurviewMenuWin) {
newPurviewMenuWin = new Ext.Window({
applyTo : 'PurviewMenu_window',
title : '菜单权限管理',
layout : 'fit',
closable : false,
width : 420,
height : 265,
plain : true,
items : _addPurviewMenuForm,
buttons : [{
text : '保存',
handler : function() {
if (_addPurviewMenuForm.form.isValid()) {
_addPurviewMenuForm.form.submit({
url : '',
waitMsg : "正在提交表单数据,请稍
候......",
failure : function(form, action) {
newPurviewMenuWin.hide();
_addPurviewMenuForm.getForm
().reset();
}
});
} else {
Ext.Msg.alert('信息', '请填写完整在提交!');
}
}
}, {
text : '取消',
handler : function() {
_addPurviewMenuForm.getForm().reset();
newPurviewMenuWin.hide();
}
}]
});
}
newPurviewMenuWin.show(this);
}
[/code]
我有一个这个的权限设置form,form里面的复选按钮都是一个一个的创建,代码如上,我现在的需求是想点一下保存按钮后去得到上面form表单里面checkbox的选中值(可以选中多个值),麻烦大家帮我实现一下,我试了很久都没有试出来。谢谢了。图片如下:
[img]http://www.iteye.com/upload/attachment/141092/8a804ed8-1193-3eb7-b6aa-d49efd2c038f.jpg[/img]