1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    2
    Vote Rating
    0
    Elfderon is on a distinguished road

      0  

    Default Component query on buttons works with title but not with id or action

    Component query on buttons works with title but not with id or action


    I have a very simple example.

    In my view I have some items, one of them is :
    Code:
    title: 'Login',                
    iconCls: 'user',
    id: 'itemId',
    action: 'myAction'
    Now, in my controller I want to know when this has been taped.

    1. This doesn't work :
    Code:
    control: {            
    'button[action=myAction]': {
              tap: 'openLoginBox'
    }
    }
    2. This doesn't work :
    Code:
    control: {            
    '#itemId': {
             tap: 'openLoginBox'
     }
     }
    3. This works :
    Code:
    control: {            
    'button[title=Login]': {
               tap: 'openLoginBox'
    }
    }
    I just want to know why, and what I am doing wrong. I want to use ids if possible not titles.

    Thank you
    Last edited by Elfderon; 14 Dec 2012 at 3:36 AM. Reason: typo

  2. #2
    Sencha User
    Join Date
    Dec 2012
    Posts
    2
    Vote Rating
    0
    Elfderon is on a distinguished road

      0  

    Default


    What I have noticed is that it's not the component query that doesn't work, but the assignation of new id doesn't work.

    All my items have the ids : ext-tab-1, ext-tab-2, ...., so doing :

    Code:
    title: 'Login',iconCls: 'user',
    id: 'itemId'
    doesn't assign the new id to the element.

    Any clues why?

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,541
    Vote Rating
    872
    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


    'button[action=myAction]' should work, in fact I use action for all my buttons and it works for me quite well.

    The itemId isn't going to work because it should be looking for an id with that value.
    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: 1

Tags for this Thread