在 html 中嵌入 EXTJS 的正确方法
在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这完全取决于您想做什么,请查看 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.