当前位置: 代码迷 >> JavaScript >> extjs 'checkboxgroup'获取值有关问题
  详细解决方案

extjs 'checkboxgroup'获取值有关问题

热度:601   发布时间:2013-06-25 23:45:41.0
extjs 'checkboxgroup'获取值问题
如下是程序,alert时,都是显示未定义,但是我一开始就定义了啊
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 = new Ext.Window({
width:340,
height:180,
title:"录入客户信息",
items:permitForm,
  相关解决方案