【问题标题】:Add component in Grid在 Grid 中添加组件
【发布时间】:2025-12-05 03:00:01
【问题描述】:

嗨,我想在网格中添加组件 我试着这样做 Rendering a component into an ExtJS grid 但我在牢房里看到 和网格下的按钮

我使用 ExtJs 4

    columns:[
      {header:"test", dataIndex:'registrationDate', width:30, renderer:function (value, id, r) {
            var id = Ext.id();
            new Ext.Button({
                text:"1", handler:function (btn, e) {
                    // do whatever you want here
                }
            }).render(document.body, id);

            return('<div id="' + id + '"></div>');
        }}
    ],

【问题讨论】:

    标签: extjs extjs4


    【解决方案1】:

    如果您只需要列中带有点击处理程序的按钮,请使用 actioncolumn xtype。

    【讨论】: