Reputation: 36166
I have a actioncolumn on my grid with this code:
this.columns =
[
{
xtype: 'actioncolumn',
items: [{
icon: '../Content/Images/Approve.png',
handler: function (grid, rowIndex, colIndex, node, e, record, rowNode) {
alert('test approve')
}
}
...rest of the columns
when I click the icon, I get the "test approve" message, so it works as expected!
If I add the render method bellow to disable the action column for rows that are already approved:
renderer: function (value, metadata, record) {
if (record.get('Approved') = 1) {
this.items[0].disabled = true
} else {
this.items[0].disabled = false;
}
}
the handler
stops working on the enabled itens. It seems like the renderer
function is preventing the handler
to be called. I even tried to add the handler
code inside the renderer
, but also no success.
Any idea why this would happen?
Upvotes: 1
Views: 1223
Reputation: 31
your condition statement in the if statement, i assume you meant to compare not assign. thats probably where your code is breaking
Upvotes: 3