简体   繁体   English

如何将extjs对象添加到html?

[英]How to add extjs object to html?

I have a simple example: 我有一个简单的例子:

 function RenderTime(v) {
    var test = new Ext.Img({
        src: "lib/Image/Paddle.png",
        listeners: {
            el: {
                click: function() {
                    Ext.Msg.alert("Message");
                }
            }
        }
    })
     return '<table width="100%"><tr><td width="90%">' + test + '</td></tr></table>'

 }

and column: 和列:

  {
                dataIndex: 'title',
                width: 500,
                sortable : false,
                renderer: RenderTitle
        },

How to correct add extjs object to html ? 如何正确将extjs对象添加到html中?

You'll want to utilize the "renderTo" attribute for your component rather than trying to concatenate it into your html manually. 您将要为组件利用“ renderTo”属性,而不是尝试将其手动连接到html中。

See: ExtJS Ext.Img.renderTo 参见: ExtJS Ext.Img.renderTo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM