1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    84
    Vote Rating
    0
    nofx is on a distinguished road

      0  

    Default (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'
    });
    

  2. #2
    Sencha User
    Join Date
    Jun 2009
    Posts
    84
    Vote Rating
    0
    nofx is on a distinguished road

      0  

    Default


    Nevermind, i figured it out. It's because i used 'app' in the namespace. Just read that i had to change it.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    16
    Vote Rating
    0
    ITS Telco is on a distinguished road

      0  

    Default 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. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    16
    Vote Rating
    0
    ITS Telco is on a distinguished road

      0  

    Default namespaces

    namespaces


    just insert

    Ext.ns('app.views');

  5. #5
    Sencha User
    Join Date
    Jun 2009
    Posts
    84
    Vote Rating
    0
    nofx is on a distinguished road

      0  

    Default


    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..?

  6. #6
    Sencha User
    Join Date
    Jun 2009
    Posts
    84
    Vote Rating
    0
    nofx is on a distinguished road

      0  

    Default


    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.

  7. #7
    Sencha User
    Join Date
    Jun 2011
    Posts
    16
    Vote Rating
    0
    ITS Telco is on a distinguished road

      0  

    Default Test environment

    Test environment


    Okay I understand. I only tested in browser.

  8. #8
    Sencha User
    Join Date
    Jun 2011
    Posts
    16
    Vote Rating
    0
    ITS Telco is on a distinguished road

      0  

    Default Namespace

    Namespace


    I always put it at the beginning of js file.

  9. #9
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,604
    Vote Rating
    818
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 2