如何在GRID - EXT JS中的特定列的每个单元格中创建按钮

How to Create a button in every Cell of a particular column in GRID - EXT JS

本文关键字:单元格 按钮 创建 GRID EXT JS      更新时间:2023-09-26

下面是我在特定列的每个单元格中创建下载链接的代码。这也很好…但在下面的代码,我使用它只允许图标的下载链接。谁能帮助我如何创建一个按钮,而不是图标列的每个单元格。

this.columns = [ {
            text : 'documentName',
            dataIndex : 'documentName',
            flex : 1.5,
            sortable : true
        }, {
            text : 'documentDescription',
            dataIndex : 'documentDescription',
            flex : 2.5,
            sortable : true
        },
    { text : 'downloadLink',,
            xtype:'actioncolumn',
            flex : 0.5,         
            items: [{
                icon: 'staticfiles/download.png',  // Use a URL in the icon config
                iconCls:'downloadHelpDocIcon',
                tooltip: 'Download',            
                handler: function(grid, rowIndex, colIndex) {
                    var rec = grid.getStore().getAt(rowIndex);
                    //alert("Edit " + rec.get('downloadLink'));
                }
            }]
        }

在items数组中添加一个按钮:

text: 'column2',
dataIndex: 'column2',
items: [{
    xtype: 'button',
    text: 'click',
    ...
}]