簡體   English   中英

如何在GRID中特定列的每個單元格中創建按鈕-EXT JS

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

下面是我的代碼,用於在特定列的每個單元格中創建下載鏈接。 這也可以正常工作。但是在下面的代碼中,我只允許使用圖標作為下載鏈接。 誰能幫助我如何為該列的每個單元格創建一個按鈕而不是圖標。

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',
    ...
}]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM