PDA

View Full Version : ext codes error within iframe



rkim
20 Jan 2012, 1:36 PM
Each page renders fine (if you remove iframe from test1.html)
but soon as you put iframe in the test1.html, error popups (happens in IE only)

var Ext = Ext || {};
(function() {
var global = this,
objectPrototype = Object.prototype, => Object is undefined here

If you let the code to continue, it renders fine though.


test.html

<script type="text/javascript" src="/enteliweb/javascript/ext4/ext-all-debug.js"></script>


<script type="text/javascript">
//Initialization
Ext.onReady(function()
{


var myBorderPanel = Ext.create("Ext.container.Viewport",
{
layout: "border",
margin:"0 0 0 0",
defaults:{border:false,header:false,defaults:{border:false}},
items: [
{
id:"centerPanel",
region: "center", // center region is required, no width/height specified
margins: "0 5 0 0",
layout:"border",
autoScroll:false,
items: {
id:"mainFramePanel",
html:"<iframe id=\"mainFrame\" name=\"mainFrame\" scrolling=\"auto\" frameborder=\"0\" src=\"test2.html\"></iframe>",
frameborder:"0",
autoMask:false
}
},
{
region: "east",
id:"east-region",
collapsible: true,
collapseMode : "mini",
split: true, // enable resizing
maxWidth: 500,
width: 320,
html:"xxx"


}]
});


});




//]]>-->
</script>



test2.html

<script type="text/javascript" src="/enteliweb/javascript/ext4/ext-all-debug.js?1.2.245"></script>
<script type="text/javascript">
//<!--/*--><![CDATA[/*><!--*/


//Initialization
Ext.onReady(function()
{


var myBorderPanel = Ext.create("Ext.container.Viewport",
{
layout: "border",
margin:"0 0 0 0",
defaults:{border:false,header:false,defaults:{border:false}},
items: [
{
id:"centerPanel",
region: "center", // center region is required, no width/height specified
margins: "0 5 0 0",
layout:"border",
autoScroll:false,
items: {
id:"mainFramePanel",
html:"",
frameborder:"0",
autoMask:false
}
},
{
region: "east",
id:"east-region",
collapsible: true,
collapseMode : "mini",
split: true, // enable resizing
maxWidth: 500,
width: 320,
html:"xxx"


}]
});


});




//]]>-->
</script>
</head>




<body>
</body>
</html>

mitchellsimoens
23 Jan 2012, 9:53 AM
The next release should have a fix to the document being ready if the code gets merged in.

rkim
1 Feb 2012, 2:13 PM
This IE9 specific bugs hasn't been fixed in Ext 4.1 beta 2.
Sounds like native objects is not accessible if it is located within iframe only.

With further investigation, we have noticed that above code renders content of iframe document twice. (so.. looks like you guys are rendering the html content twice) - test2.html

If we downgrade to Ext 4.0.7, no error comes up