在電網「actioncolumn」我用「渲染」像顯示的圖像,如何調用操作僅在操作列圖像不能在網格單元
圖像+文字
在操作欄點擊我打電話一些行動,
但點擊事件觸發甚至點擊網格單元格中的空白空間。 如何防止點擊空的空間。
如何識別點擊鏈接(圖片+文字),而不是網格單元格的空白處。
{
xtype: 'actioncolumn',
width: '17%',
text: 'Display Option',
renderer: function (value, metadata, record) {
var label = '';
if (record.get('status') == 0) {
lable = 'Show';
etadata.style += 'margin-top:10px;cursor:pointer;';
return '<span style="font-size: 14px; color:#3b87de; font-family:arial; margin-left:-3px;">' + '<img src="resources/images/show_msg.png"/>' + label + '</span>'
} else {
metadata.style += 'margin-top:10px;cursor:pointer;';
lable = 'Hide';
return '<span style="font-size: 14px; color:#3b87de; font-family:arial;">' + '<img src="resources/images/hide_fault.png"/>' + label + '</span>'
}
},
handler:function(grid, rowIndex, columnIndex, e){
console.log('handler test');//not triggering
},
listeners: {
click: function (grid, rowIndex, colIndex) {
console.log('handler test');// triggering
}
}
感謝
您是如何將操作鏈接到動作列的?我經常使用actioncolumns,從來沒有這個問題。我將粘貼我通常使用的代碼。 – 2015-02-23 11:51:58