2

我正在尝试在其他预先创建的面板上创建一个浮动面板,我尝试遵循简单的代码,但失败了:

var testPanel = new Ext.Panel({
                                id: 'testP',
                                width: 50,
                                height: 100,
                                floating: true,
                                title:'Test'
                            });
testPanel.show();

我还需要考虑什么?

谢谢!

4

1 回答 1

1

使用配置时需要注意以下floating几点:

1) 固定宽度 - 你已经完成了 2) 位置必须在渲染后明确设置(例如,myPanel.setPosition(100,100);)。

您还可以设置底层 Ext.Layer 配置选项,而不仅仅是设置floating : true. 您可以通过以下方式执行此操作:

Ext.Panel({

  //.. other config..,
  floating : {
    //Ext.Layer config options. Maybe a property in that will get you the desired effect that you're looking for.
  }
});

试试这个并更新!

干杯。

于 2011-10-02T08:40:39.403 回答