我有一个包含搜索结果的列,但是我需要在单击按钮后显示结果中添加的一些信息,但我该怎么办呢? 我需要创建一个按钮来显示,有人可以帮助我吗?
TKS。 罗德里戈。
答案 0 :(得分:2)
您可以使用操作列:
{
xtype:'actioncolumn',
width:50,
items: [{
icon: 'extjs-build/examples/shared/icons/fam/cog_edit.png', // Use a URL in the icon config
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Edit " + rec.get('firstname'));
}
},{
icon: 'extjs-build/examples/restful/images/delete.png',
tooltip: 'Delete',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Terminate " + rec.get('firstname'));
}
}]
}
答案 1 :(得分:1)
我认为您正在寻找的是ActionColumn(在谷歌上很难找到......):
http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.grid.column.Action