-
4 Aug 2011 2:23 AM #1
(basic) button not working?
(basic) button not working?
Hi, i'm using the following view to display a toolbaar with a button in it. But nothing happends when i press the button... I don't even see the button image change from button-up to button-down. Anyone any idea why?
Code:app.views.test = Ext.extend(Ext.Panel, { fullscreen: true, dockedItems: [ { dock : 'top', xtype: 'toolbar', title:'Standard Titlebar' }, { dock : 'top', xtype: 'toolbar', ui : 'light', items: [ { text: 'Test Button', handler: function() { alert('aaa'); //Not working... } } ] } ], html: 'Testing' });
-
4 Aug 2011 2:32 AM #2
Nevermind, i figured it out. It's because i used 'app' in the namespace. Just read that i had to change it.
-
4 Aug 2011 2:54 AM #3
Works perfect !
Works perfect !
i have no problems.
i touch the buttons and the message box with aaaa appear.
how does you tested it ?
-
4 Aug 2011 2:57 AM #4
namespaces
namespaces
just insert
Ext.ns('app.views');
-
4 Aug 2011 2:59 AM #5
It worked for me once, then i tried to do the alert in a controller instead of the view itself. That didn't seem to work. So i put the alert back in the handler of the view and now i have the same problem again... My button wont react when i press it...
Anyone any idea whats going on...???
BTW. what is "Ext.ns('app.views');" and where do it put it..?
-
4 Aug 2011 3:30 AM #6
Ok, i just found the REAL problem. When my phone is connected to the USB cable, then for some reason the handlers won't react to button presses. When i disconnect my phone from the USB cable everything works fine.
-
4 Aug 2011 3:56 AM #7
Test environment
Test environment
Okay I understand. I only tested in browser.
-
4 Aug 2011 3:56 AM #8
Namespace
Namespace
I always put it at the beginning of js file.
-
4 Aug 2011 8:30 AM #9Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
If you use Ext.Application, it will set up the follow namespaces for you:
app.controllers
app.models
app.stores
app.views
Of course you can change the name of the app.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote