I want to create a empty viewport(layout:border) first, then add items to it, finally render and show. but when I created the viewport element, it throw an error, says:
Uncaught TypeError: Cannot read property 'flex' of undefined
here are my code:
<script type="text/javascript" src="ext-4.0.2a/bootstrap.js"></script>
<script>
Ext.require(['*']);
Ext.onReady(function() {
Ext.QuickTips.init();
var viewport = Ext.create('Ext.container.Viewport', {
layout: 'border'
});
var north = blablabla...
viewport.add([north,south]);
viewport.doLayout();
});
</script>
I want to create a empty viewport(layout:border) first, then add items to it, finally render and show. but when I created the viewport element, it throw an error, says:
Uncaught TypeError: Cannot read property 'flex' of undefined
here are my code:
<script type="text/javascript" src="ext-4.0.2a/bootstrap.js"></script>
<script>
Ext.require(['*']);
Ext.onReady(function() {
Ext.QuickTips.init();
var viewport = Ext.create('Ext.container.Viewport', {
layout: 'border'
});
var north = blablabla...
viewport.add([north,south]);
viewport.doLayout();
});
</script>
Share
Improve this question
edited Jul 31, 2011 at 16:17
Chau
5,5709 gold badges67 silver badges99 bronze badges
asked Jul 29, 2011 at 13:38
missingcat92missingcat92
1,2262 gold badges14 silver badges23 bronze badges
1 Answer
Reset to default 7According to notes that are taken from docs:
The regions of a BorderLayout are fixed at render time and thereafter, its child Components may not be removed or added.To add/remove Components within a BorderLayout, have them wrapped by an additional Container which is directly managed by the BorderLayout.
And by the way
Any Container using the Border layout must have a child item with region:'center'
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745215658a4617004.html
评论列表(0条)