我有一些预先存在的 js 代码,可以通过 DOM 操作 div
。我有一个带有边框布局的 Ext.container.Viewport 。我想在视口(viewport)中心区域的面板中显示 div
的内容。
HTML
<div id="contents"></div>
EXTJS
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [{
region: 'north',
...
}, {
region: 'center',
items: [{
// #contents;
}]
]}
});
最佳答案
您可能对 contentEl
感兴趣配置选项。来自文档:
Specify an existing HTML element, or the id of an existing HTML element to use as the content for this component.
This config option is used to take an existing HTML element and place it in the layout element of a new component (it simply moves the specified DOM element after the Component is rendered to use as the content.
文档中还有一些附加注释,但这听起来正是您正在寻找的内容。
关于javascript - 是否可以在extjs面板中显示div的内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7708274/