PDA

View Full Version : ActionCloumn with multiple icons



erdna
1 Jan 2012, 6:01 AM
I use a MVC structur.
In the list view i use a actioncolumn:


xtype: 'actioncolumn',
action: 'action',
items: [{
action: 'delete',
icon: 'css/icons/silk/delete.png'
},{
action: 'layout',
icon: 'css/icons/silk/layout_edit.png'
}]

In the controller I can register a handler to the actioncolumn.


init: function() {
this.control({
'mylist actioncolumn[action=action]': {
click: this.onActionColumnActionClicked
}
});
}

How I can register different handlers to each icon?

mitchellsimoens
2 Jan 2012, 6:39 AM
Each icon isn't a component so you won't be able to resolve it using ComponentQuery. You will just have to listen for when the whole action column is clicked on and then figure out the icon that was clicked on.