Hybrid View
-
30 Jan 2013 3:50 AM #1
Unanswered: Why the the whole page disappeared after I insert or add components to another ?
Unanswered: Why the the whole page disappeared after I insert or add components to another ?
Why the the whole page disappeared after I insert or add components to another ?
I have encountered this problem many times. And the reason the page disappear is that the height of dom elements become zero. If I reset their height in firebug one by one, they will show up again, including the new components I inserted/added.
Now, I am suffering from the same problem again.
I load several comments into a comment container as following:
The comment container:Code:commentStore.load({callback:function(store){Ext.suspendLayouts();Ext.each(store, function(record){var comment = Ext.getCmp('commentContainer').add({xtype:'comment'}); //Set the contents, user photo etc. to the comment //It will add new items to the comment.}); Ext.resumeLayouts(true);}});
The only way to prevent the problem is to give the container a specific height.Code:{xtype:'container',defaults:{flex:1},layout:{type:'vbox',align:'center',padding:10}}
But I hope it can resize to the contents automatically.
I try to set autoHeight to true, but it's not working.
Can anybody help?
-
30 Jan 2013 6:45 PM #2
Sorry, I don't know how to increase the height of the code region. The code below maybe more readable.
comment loading:
commentStore.load({callback:function(store){Ext.suspendLayouts();
Ext.each(store, function(record){var comment = Ext.getCmp('commentContainer').add({xtype:'comment'});//Set the contents, user photo etc. to the comment//It will add new items to the comment.
});
Ext.resumeLayouts(true);}});
comment container:
{xtype:'container',defaults:{flex:1},layout:{type:'vbox',
align:'center',padding:10}}


Reply With Quote