After much googling I found a hidden property of Button called action. I can't find very good documentation on it and wanted to show an example of it because it will make your life so much easier.
// Building a button inside of an items array { xtype: 'button', action: 'warnOnLeave', align: 'left', iconCls: 'home', ui: 'back', } // Handle the button click inside a controller control: { // Listen for the new button press 'button[action=warnOnLeave]':{ tap: 'onCreateNewContent' } }
This saved me quite a few steps because all my button actions triggered something in the controller. This way I can skip using fireEvent and just tie the event to a handler method in the controller.
No comments:
Post a Comment
If you found this page useful, or you have any feedback, please leave a comment.