In my application, I have several views that have the same buttons on the toolbar. In the contraoller, I would like to use one ComponentQuery only to listen to the click event on all similar buttons.
My view 1 is as follows:
alias: 'widget.view-type1',
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [{
text: 'Add',
itemId: 'add'
}
In my controller, instead of calling
init: function(){
this.control({
'view-type1 #add, view-type2 #add, view-type3 #add, view-type4 #add': {click: this.onButtonAdd},
I'd like something like
init: function(){
this.control({
'view-generic #add': {click: this.onButtonAdd},
I should be able to add a config property to my view 1, like:
secondaryAlias: 'widget.view-generic',
But this does not exist.
My question is, how to declare those views in such a way, that I can target them all together with a simple ComponentQuery. I hope this explanation is clear enough.