PDA

View Full Version : Error while i add a viewport in the items collection of Window



nil5286
3 May 2012, 6:56 AM
I am just trying to add the viewport in Ext.window.Window but it gives me an error.

Test.html


<link rel="stylesheet" type="text/css" href="Scripts/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="Scripts/ext/ext-all-debug-w-comments.js"></script>
<script type="text/javascript">
Ext.Loader.setConfig({ enabled: true });


Ext.onReady(function () {


var view = Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [
{
title: 'North Panel',
region: 'north',
height: 75,
collapsible: true
},
{
title: 'South Panel',
region: 'south',
height: 75,
collapsible: true
},
{
title: 'East Panel',
region: 'east',
width: 100,
collapsible: true
},
{
title: 'West Panel',
region: 'west',
width: 100,
collapsible: true,
collapseMode: 'mini'
},
{
title: 'Center Region',
region: 'center',
id: 'centerPanel',
html: 'Disposable'
}
]
});


Ext.create('Ext.window.Window', {
id: 'win1',
modal: true,
renderTo: Ext.getCmp("div1"),
items: [view],
resizable: false,
height: 300,
width: 600
}).show()
});
</script>


</head>
<body>
<div id="div1"></div>
</body>
</html>


I get the below error: Node cannot be inserted at the specified point in the hierarchy
34838

Tim Toady
3 May 2012, 7:04 AM
The purpose of a viewport is to take up the full width and height of the entire browser space. It doesn't make sense to be the child of a window. Also, you probably don't want to specify renderTo on a window.