extjs - 如何在rowBody中将面板添加到extjs网格面板

标签 extjs gridpanel

我不会在ext网格面板中添加ext面板而不是html。我现在所拥有的是:

features: [{
    ftype: 'rowbody',
    getAdditionalData: function (data, rowIndex, record, orig) {
        var headerCt = this.view.headerCt,
            colspan = headerCt.getColumnCount();
        // Usually you would style the my-body-class in CSS file
        return {
            rowBody: '<div style="padding: 1em">' + record.get("description") + '</div>',
            rowBodyCls: "my-body-class",
            rowBodyColspan: colspan
        };
    }
}],

但是,我希望取代标准的面板而不是rowBody,以便可以添加按钮和其他布局。

那是可能的吗?

最佳答案

我正在使用ExtJS 4.2,为了使其工作,Controller代码如下所示:

Ext.define('My.controller.MyController1', {
extend: 'Ext.app.Controller',

onGridPanelExpandbody: function(rowNode, record, expandRow, eOpts) {
    var id = 'group-row-' + record.get('Id');
    var tpl = new Ext.XTemplate('<tpl foreach=".">',
                                '<p> {#}.{$} - {.}</p>', 
                                '</tpl>');
    var el = document.getElementById(id);
    tpl.overwrite(el,record.data);
},

init: function(application) {
    this.control({
        "gridpanel[itemid='usergroupsList'] tableview": {
            expandbody: this.onGridpanelExpandbody
        },
    });
},
}

注意区别,你的grid,我的代码是gridpanel tableview

关于extjs - 如何在rowBody中将面板添加到extjs网格面板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11162622/

相关文章:

javascript - 如何在树数据上使用自定义

javascript - Extjs 3.4 -> 窗口不显示

javascript - 在 Sencha-Touch 2 应用程序中加载外部 Web 应用程序

extjs - 防止网格面板的键盘多选

Javafx:GridPane:当文本太长时防止列宽度增加

javascript - 使用 Sencha CMD 缩小现有 ExtJS 应用程序

Extjs : How to enable/disable a checkbox using renderer while loading a grid

datetime - ExtJs4,如何在gridpanel中手动编辑具有文本格式(没有时间字段或日期字段)的单元格日期时间?

sql - ExtJS 日期格式问题

javascript - 从 ExtJS 中的 GridPanel 获取模型