开发者

ExtJS Element to Component

I want to take an ExtJS element(div) retrieved from the DOM selector, and convert that to an 开发者_高级运维ExtJS Component(a panel). How can I go about doing this? Thanks.


You want to use the contentEl config. It places what is in the div into the panel.

<html>
  <head>
    <link rel="stylesheet" href="ext-3.1.1/resources/css/ext-all.css" />
    <script src="ext-3.1.1/adapter/ext/ext-base.js"></script>
    <script src="ext-3.1.1/ext-all-debug.js"></script>
    <script>
      Ext.BLANK_IMAGE_URL = 'ext-3.1.1/resources/images/default/s.gif';
      Ext.onReady(function(){
        var viewport = new Ext.Viewport({
          items: [{
            title: 'About Us',
            width: 200,
            height: 200,
            contentEl: 'about_us'
          }]
        });
      });
    </script>
  </head>
  <body>
    <div id="about_us">We are a great team to work with!</div>
  </body>
</html>

ExtJS Element to Component

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜