javascript - 是否可以在extjs面板中显示div的内容?

标签 javascript html extjs extjs4

我有一些预先存在的 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/

相关文章:

JavaScript : show the measure of data transfer between client and server

JavaScript/Jquery : issue with append in cycle

javascript - 横幅旋转器在浏览器中给出 "loading"消息

html - Jquery Mobile 链接停止为页面工作

sencha-touch - 如何为 Sencha Touch 2.x 应用程序生成脚手架?

javascript - 仅当单击复选框时才选择行 ExtjS 4

php - 禁用表单中选定提交按钮的回车键

javascript - 如何执行包含空字符串作为结果一部分的 firebase 查询?

javascript - 想要使用每 1 秒运行一次的无限循环使用普通 javascript 更改 html 网页中的文本,但是当我加载时网页卡住了

javascript - 如何从标记字段中删除 Box