日期:2014-05-16  浏览次数:20932 次

下拉框选择,刷新下面的checkboxGroup,但是ie出不来,报this.items.0.items为空或不是对象,求教! - Web 开发 / Ajax
Ext.namespace("exam.xtgl.jsqx");

exam.xtgl.jsqx.formPanel = null;
exam.xtgl.jsqx.formPanel2 = new Ext.Panel({
layout:'form',
labelWidth:80,
border:false
});
exam.xtgl.jsqx.initjsqxForm = function()
{
var form = new Ext.FormPanel({
layout:'fit',
border:false,
autoScroll:true,
height:700,
anchor : '100%',
bodyStyle:'padding:3px',
tbar:[{
text:'保存',
iconCls:'btnIconSave',
id:'saveBtn'
// handler:exam.xtgl.jsqx.saveJsqxHandeler
},{
text:'关闭',
iconCls:'btnIconClose',
id:'closeBtn',
handler:function()
{
exam.xtgl.js.jsWin.close();
}
}],
items:[{
autoHeight:true,
height:600,
xtype:'fieldset',
title:'角色权限',
items:[{xtype:'hidden',
fieldLabel:'系统id',
id:'sysId',
name:'sysId'
},
{
border:false,
layout:'form',
border:false,
labelWidth:120,
items:[{
fieldLabel : '选择设置权限的模块',  
xtype:'combo',
mode:'local',
id:'moparentId',
name:'moparentId',
labelWidth:80,
triggerAction:'all',
fields:['moparentId','modName'],
store:[[1,'系统管理'],[2,'考试设计'],[3,'考试安排']],
listeners:{'select':function (combo){
Ext.Ajax.request({  
url : exam.webContextRoot + '/mkgl_queryModels.action',//请求URL 用于请求分类  
method : 'POST',  
params : {  
moparentId : combo.value
},
success : function(response, options) {  
var roleArr = new Array();// 标签分类数组 
roleObj = Ext.util.JSON.decode(response.responseText); 
for (i = 0; i < roleObj.length; i++) {  
var role = roleObj[i];
var cbgrole = getCheckboxGroup(role.modName,role.modId,getAllCheckbox(role));// 创建复选框组  
alert(cbgrole.fieldLabel);
exam.xtgl.jsqx.formPanel2.add(cbgrole); 
}  
exam.xtgl.jsqx.formPanel.doLayout();//重新调整版面布局  
}
});  
}
}
}
]
},
exam.xtgl.jsqx.formPanel2
]
}]
})
exam.xtgl.jsqx.formPanel = form;
return form;
};
 

// 获取创建复选框组  
function getCheckboxGroup(cbgFl, cbgId,item) {  
alert(cbgFl);
var checkboxGroup = new Ext.form.CheckboxGroup({  
xtype:'checkboxgroup',
fieldLabel:cbgFl,
itemCls: 'x-check-group-alt',
name:cbgId,
items:item,
columns : 5  
  });  
return checkboxGroup;
};  
 
function getAllCheckbox(role) {
var labelArr = new Array();  
Ext.Ajax.request({  
url : exam.webContextRoot + "/mkgl_queryModelFunctions.action",//请求URL 用于请求标签分类下的标签名  
method : 'POST',  
params : {  
modId : role.modId 
}, 
success : function(response, options) {  
var labelObj = Ext.util.JSON.decode(response.responseText); 
labelArr.push({
boxLabel:role.modName,
name:role.modName,
id:role.modName
});
if(exam.xtgl.jsgl.jsId =