How to add a click event in controller for Action Column Item using Architect?
Hi guys,
I have an action column item and I want create a click event in my controller. I know there is a handler event in the action column itself. But I really need to reference in my controller file. I can't find any id/itemid property for action column item. So how how can a refer this element in the controller.
Please help me. here is my code
Code:
.........some other grid items ..........
{
xtype: 'actioncolumn',
id: 'acViewCashDetails',
width: 50,
align: 'center',
items: [{
getClass: function(v, metadata, r, rowIndex, colIndex, store) {
if(r.get('referral_count')>0){
this.items[0].tooltip='Click to view the details.';
return 'view';
}else{
return '';
}
},
handler: function(view, rowIndex, colIndex, item, e) {
//some codes here. then it will work but, i already have a function in controller
// and I really want to use that function or just want create another in controller
}
}
]
}
........some other grid items .......
Action Column with controller
Worked for me, and thanks for the example. i was not getting the handler part, and then i found this
In the Grid Panel i create a Custom Event with a parameter record;
At then Action Column handler:
handler: function(view, rowIndex, colIndex, item, e, record, row) {
view.up('grid panels widget').fireEvent('My grid Custom Event',record);
},
at the Controller i created the listener and worked just fine.
Regards