0
votes

I have a problem with Window.doLayout() method. It doesn't show on the screen what it suppose to show, well exactly it doesn't show anything. When I change the method to show() it works correctly, but it don't add panels when I click on the button which is handled by anonymous function. I would really appreciate, help up here. Thanks :)

Ext.onReady(function(){
  var childPnl1 = {
    frame : true,
    height : 50,
    html: 'My First Child Panel',
    title : 'First children are fun'
  };
var childPnl2 = {
    width : 150,
    html: 'Second child',
    title : 'Second children have all the fun!'
};
var myWin = new Ext.Window({
  height
    : 300,
  width
    : 300,
  title
    : 'A window with a container layout',
  autoScroll : true,
  items
    : [
    childPnl1,
    childPnl2
  ],tbar : [
  {
    text: 'Add child',
    handler : function() {
    var numItems = myWin.items.getCount() + 1;
    myWin.add({
       title
        : 'Child number ' + numItems,
       height
        : 60,
       frame
        : true,
       collapsible : true,
       collapsed
        : true,
       html
        : 'Yay, another child!'
     });
    myWin.doLayout();
 }
}
]
});
})
1

1 Answers

2
votes

make sure you call win.show() or configure the window as shown hidden:false

http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.window.Window-cfg-hidden