【问题标题】:Extjs 3.4 -> Window doesn't showExtjs 3.4 -> 窗口不显示
【发布时间】:2013-10-19 12:02:07
【问题描述】:

我对 Window.doLayout() 方法有疑问。它没有在屏幕上显示它应该显示的内容,确切地说它没有显示任何内容。当我将方法更改为 show() 时,它可以正常工作,但是当我单击由匿名函数处理的按钮时,它不会添加面板。 我真的很感激,在这里帮忙。谢谢:)

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();
 }
}
]
});
})

【问题讨论】:

    标签: javascript extjs window


    【解决方案1】:

    确保调用 win.show() 或将窗口配置为 hidden:false

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-03
      相关资源
      最近更新 更多