[英]How to Create a button in every Cell of a particular column in GRID - EXT JS
Below is my code to create an download link in a everycell of a particular column. 下面是我的代码,用于在特定列的每个单元格中创建下载链接。 This is working fine too.. But in the below code that i used it allows only Icon for the download link.
这也可以正常工作。但是在下面的代码中,我只允许使用图标作为下载链接。 Can anyone please help me how to create a button instead of icon for every cells of the column.
谁能帮助我如何为该列的每个单元格创建一个按钮而不是图标。
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'));
}
}]
}
Just add a button to the items array: 只需向items数组添加一个按钮:
text: 'column2',
dataIndex: 'column2',
items: [{
xtype: 'button',
text: 'click',
...
}]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.