在 html 中嵌入 EXTJS 的正确方法

发布于 2024-12-01 01:49:47 字数 334 浏览 3 评论 0原文

在 html 中粘贴 Extjs 元素的推荐方法是什么?

目前我有

<div><script type='text/javascript'>
    Ext.onReady(function(){
         new Ext.grid.Panel({params...}).show();
    })
</script></div>

但这感觉很尴尬(到处嵌入脚本标签让我的灵魂感到不舒服)

组件有一个 renderTo,但如果 html 元素不存在,-我想? (对此不太确定) - 组件仍然被创建。

What is the recommended way to stick Extjs elements in your html?

At the moment I have

<div><script type='text/javascript'>
    Ext.onReady(function(){
         new Ext.grid.Panel({params...}).show();
    })
</script></div>

But this feels very awkward ( Embedding script tags all over the place rankles my soul )

Components have a renderTo, but if the html element doesn't exist, - I think? ( not too sure about that ) - that the component still gets created.

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

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

发布评论

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

评论(1

朦胧时间 2024-12-08 01:49:47

这完全取决于您想做什么,请查看 Sencha 上的学习中心:

http://www.sencha。 com/learn/

http://www.sencha.com/learn/components/

通常你使用完整的布局系统,不过,如果您想附加到现有元素(例如 div),您将需要诸如 renderTo 之类的东西。

It depends entirely on what you want to do, check out the learning centre on Sencha:

http://www.sencha.com/learn/

http://www.sencha.com/learn/components/

Usually you use a complete layout system, though if you want to attach to an existing element, such as a div you'll need something like renderTo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文