fengdliulang 2008-10-31 21:53
浏览 271
已采纳

纯EXT代码,FF运行正常,IE运行失败

此段代码运行于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代码
  • 写回答

1条回答 默认 最新

  • kimmking 博客专家认证 2008-10-31 21:53
    关注

    把winGetFormInfo.doLayout(); 注释掉

    ff和ie里都报错

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 WPF使用Canvas绘制矢量图问题
  • ¥15 用三极管设计一个单管共射放大电路
  • ¥20 fluent无法启动
  • ¥15 孟德尔随机化r语言运行问题
  • ¥15 pyinstaller编译的时候出现No module named 'imp'
  • ¥15 nirs_kit中打码怎么看(打码文件是csv格式)
  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决