-
4 Jan 2013 11:21 AM #1
Unanswered: Custom button config
Unanswered: Custom button config
I give all of my buttons a custom config property called action.
Then in my controller I have something likeCode:items: [ { text: 'Update Case', action: 'updateCase', xtype: 'button' }, { text: 'Close Case', action: 'closeCase', xtype: 'button' } ]
It works fine in chrome, but when I make a package and test it on the iPhone the action is no longer available and/or lost. I added a Ext.msg.alert before the if statement and printed out button.action and it was empty.Code:if (button.action == 'updateCase')
I had to add a workaround:
which works for now but it would be a lot smoother if I could use just button.action.Code:button.getInitialConfig('action')
Sidenote:
I have tried button.getAction() and that does not work.
Thanks!
-
4 Jan 2013 5:48 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
- Answers
- 83
have you tried button.config.action? To be honest, this type of ad-hoc stuff is discouraged. The config system helps define an PI. If you need special functionality, consider extending.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
7 Jan 2013 9:17 AM #3
Thanks for the response.
It looks like button.config.action works.
Thanks!

