此段代码运行于FF中正常,运行于IE中失败,没有错误提示;跟踪发现运行中创建的各对象都存在;
怀疑是布局问题导致无法显示于IE中;可是换了几种布局发现没有效果
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Hello World Window Example</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css">
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../ext-all.js"></script><script type="text/javascript">
Ext.onReady(function(){var txtanswer = '' ;
var winGetFormInfo = '' ;
var txtanswerwenda = '';
var labelanswer = new Ext.form.Label({
text:'请输入题目答案:',
id:'${pid}_TestButton_${id}_labelanswerid'
});this.p = new Ext.Panel({ id:'${pid}_TestButton_${id}_id', layout:'table' }); var btnCheck = new Ext.Button({ id:'${pid}_TestButton_${id}_btnCheck', text:'问卷录入', handler: function(){winGetFormInfo.show(); } }); var btnField = new Ext.Button({ id:'${pid}_TestButton_${id}_btnField', text:'填空型问卷录入', handler: function(){Ext.Msg.alert('系统提示', '成功!');} }); var btnView = new Ext.Button({ id:'${pid}_TestButton_${id}_btnView', text:'最近预览', handler:function (){addTab('最近预览', '../Page/Load.jypx?Configid=iccswjdcview');} }); this.p.add(btnCheck);
// this.p.add(btnField);
this.p.add(btnView);// function FromAdd()
// {
var panelTitle = new Ext.Panel({
layout:'column'
});p = new Ext.Panel({ id:'${pid}_TestCheckbox__TestButton_${id}_id', autoScroll:true }); var panelRadionCheckbox = new Ext.Panel({ layout:'column' }); var panelTextArea = new Ext.Panel({ // layout:'column' //导致滚动条消失 }); var paneltxt = new Ext.Panel({ autoScroll:false ,layout:'fit' // layout:'column' }); var typeRadio = new Ext.form.Radio ({ id:"${pid}_TestCheckbox__TestButton_${id}_name1", name : "name1", checked:true , boxLabel:"单选" }); var typeCheckbox = new Ext.form.Radio ({ id:"${pid}_TestCheckbox__TestButton_${id}_name2", name : "name1", boxLabel:"复选" }); var typetxt = new Ext.form.Radio ({ id:"${pid}_TestCheckbox__TestButton_${id}_name3", name : "name1", boxLabel:"问答" }); panelRadionCheckbox.add(typeRadio); panelRadionCheckbox.add(typeCheckbox); panelRadionCheckbox.add(typetxt);
typeRadio.on
({
check: function(rdo,checked)
{
if(checked == true)
{p.remove(paneltxt); paneltxt.destroy();
p.doLayout();
paneltxt = null ;paneltxt =new Ext.Panel({ autoScroll:false ,items:[labelanswer] ,layout:'fit'
});
// paneltxt.add(labelanswer);
paneltxt.add(txtanswer);
paneltxt.doLayout();
p.add(paneltxt);
p.doLayout();
winGetFormInfo.doLayout();
}} }); typeCheckbox.on("check",function(rdo,checked){ if(checked == true ){ p.remove(paneltxt); paneltxt.destroy(); p.doLayout(); paneltxt = null ; paneltxt =new Ext.Panel({ autoScroll:false ,items:[labelanswer] ,layout:'fit'
});
// paneltxt.add(labelanswer);
paneltxt.add(txtanswer2);
paneltxt.doLayout();
p.add(paneltxt);
p.doLayout();
winGetFormInfo.doLayout();
}
});typetxt.on("check",function(rdo,checked){ if(checked == true ){ p.remove(paneltxt); paneltxt.destroy(); p.doLayout(); paneltxt = null ; paneltxt =new Ext.Panel({ autoScroll:false ,items:[labelanswer],layout:'fit'
});
//paneltxt.add(labelanswer);
paneltxt.add(txtanswer3);
paneltxt.doLayout();
p.add(paneltxt);
p.doLayout();
winGetFormInfo.doLayout();} }); var label = new Ext.form.Label({ text:'请输入题目问题:' }); var txt = new Ext.form.TextArea({ height:'100', width:'750', id:'${pid}_TestCheckbox_${id}_subject' }); txtanswer = new Ext.form.TextArea({ autoShow:true, height:'230', width:'750', emptyText:'若有多个答案,需要使用符号 * 隔开;如:A:东方 * B:南方 * D:北方...(此要求同样适合于
复选类型)',
id:'${pid}_TestCheckbox_${id}_answer'
});
txtanswer2 = new Ext.form.TextArea({
autoShow:true,
height:'230',
width:'750',
emptyText:'此为复选类型,输入答案会自动转化为对应的格式...',
id:'${pid}_TestCheckbox_${id}_answer2'
});
txtanswer3 = new Ext.form.TextArea({
autoShow:true,
height:'230',
width:'750',
emptyText:'这里输入问答类型题目的答案...',
id:'${pid}_TestCheckbox_${id}_answer3'
});var btnSave = new Ext.Button({ id:'${pid}_TestCheckbox__TestButton_${id}_btn1', text:'确定', handler: function(){Ext.Msg.alert('系统提示', '成功!');} }); var btnGoOn = new Ext.Button({ id:'${pid}_TestCheckbox__TestButton_${id}_btn3', text:'继续添加' }); var btnQuery = new Ext.Button({ id:'${pid}_TestCheckbox__TestButton_${id}_btn2', text:'预览', handler:function (){addTab('预览', '../Page/Load.jypx?Configid=iccswjdcview');} }); var panelbtn = new Ext.Panel({ layout:'column' }); var labeltitle = new Ext.form.Label({ width:'98', text:'问卷标题:' }); var txtwenjuan = new Ext.form.TextField({ width:'750' }); //标题 panelTitle.add(labeltitle); panelTitle.add(txtwenjuan); //题目 panelTextArea.add(label); panelTextArea.add(txt); paneltxt.add(labelanswer); paneltxt.add(txtanswer);
//按钮
p.add(panelTitle); p.add(panelRadionCheckbox); p.add(panelTextArea); p.add(paneltxt); winGetFormInfo = new Ext.Window({ layout: 'fit', width: 900, height:500, labelWidth:'100', title: '选择型问卷录入', closeAction:'hide', plain: true, items:[p] }); winGetFormInfo.show();
} );
</script>
</head>
<body>
</body>
</html>
问题补充
是EXT代码;非JAVA代码