[英]How do i add a button in an Actioncolumn in extjs
我希望這是我今天的最后一個問題。 我在設計器2中找到了一個不錯的actioncolumn選項。我在網格中添加了一個,看起來像這樣:
xtype: 'gridpanel',
title: 'Reports',
forceFit: true,
store: 'ReportsStore',
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'Name',
text: 'Name'
},
{
xtype: 'gridcolumn',
dataIndex: 'Type',
text: 'Type'
},
{
xtype: 'gridcolumn',
dataIndex: 'Description',
text: 'Description'
},
{
xtype: 'actioncolumn',
dataIndex: 'Name',
items: [
{
handler: function(view, rowIndex, colIndex, item, e) {
console.log(row, col);
},
altText: 'Run report',
iconCls: 'runReport'
}
]
}
],
viewConfig: {
},
dockedItems: [
{
xtype: 'toolbar',
dock: 'top',
items: [
{
xtype: 'tbfill'
},
{
xtype: 'button',
iconCls: 'addReport',
text: 'Add report',
listeners: {
click: {
fn: me.onButtonClick,
scope: me
}
但是什么也沒發生。 我想要的是有一個按鈕/圖標,當您單擊它時,它將打開帶有該行的reportId的ext.window。 我找不到與設計師一起執行此操作的方法。
我現在沒有看到圖標,因此沒有任何可點擊的。 我想念什么?
謝謝,
TJ
您會錯過此按鈕的監聽器:
在項目定義中添加類似的內容:
handler: function(grid, row, col) {
console.log(row, col);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.