当面板已经渲染到其他 div 时,如何将面板重新渲染到不同的 div

发布于 2024-07-14 23:45:55 字数 233 浏览 3 评论 0原文

我创建了一个 Ext.Panel 对象,它正确呈现到我的页面上指定的 div 元素。

我想将面板对象底层元素(之前渲染的 div 元素)替换为另一个将动态识别的 div。

在这里,我不想通过指定已识别的 div 元素再次创建 Panel 对象,我需要利用现有的面板对象,并需要在已识别的 div 存在的位置显示面板。

任何人都可以帮助我解决这个问题吗?

谢谢 文卡特

I have created a Ext.Panel object, it rendered properly to specified div element on my page.

I want to replace the panel object underlying element(previously rendered div element) to another div which will be identified dynamically.

Here I don't want to create the Panel object once again by specifying identified div element, I need to make use of existing panel object and need to show the panel in the place where the identified div exists.

Can any one helps me regarding this.

Thanks
Venkat

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坏尐絯 2024-07-21 23:45:55

如果您将面板创建为自定义扩展,并具有自己的命名空间:

Ext.namespace('My.Panel');

My.Panel.SomePanel = Ext.extends(Ext.Panel,{
    // Your custom panel configuration here
    itemId:'myPanel'
});

Ext.reg('mypanel',My.Panel.SomePanel);

那么您可以在需要时创建面板,甚至可以通过您注册的 xtype 引用它:

var myWin = new Ext.Window({
    title:'Some Title',
    height: 300,
    width: 300,
    items:[{
        xtype: 'mypanel',
        data: someData
    }]
});

var myTabs = new Ext.TabPanel({
    title: 'Some Tab Panel',
    activeTab: 0,
    items:[{
        xtype: 'mypanel',
        title: 'SomePanel number 1'
    }]
});

If you create your panel as a custom extension, with it's own namespace:

Ext.namespace('My.Panel');

My.Panel.SomePanel = Ext.extends(Ext.Panel,{
    // Your custom panel configuration here
    itemId:'myPanel'
});

Ext.reg('mypanel',My.Panel.SomePanel);

Then you can create your panel whenever it might be needed, even referencing it by the xtype you've registered:

var myWin = new Ext.Window({
    title:'Some Title',
    height: 300,
    width: 300,
    items:[{
        xtype: 'mypanel',
        data: someData
    }]
});

var myTabs = new Ext.TabPanel({
    title: 'Some Tab Panel',
    activeTab: 0,
    items:[{
        xtype: 'mypanel',
        title: 'SomePanel number 1'
    }]
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文