1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    148
    Answers
    12
    Vote Rating
    10
    pentool will become famous soon enough

      0  

    Default Answered: How to get the buttons in a titlebar?

    Answered: How to get the buttons in a titlebar?


    According to the docs, the default items of the titlebar is xbutton. So I have a titlebar and three buttons added to it. So the titlebar has three items. One button aligned to left and two to the right.

    However, when in my controller I do a this.getTitleBar().getItems() it doesn't return buttons. It returns containers and components. One of the component is the title of the titlebar, which I get.

    In order to get to the buttons, they are buried as innerItems of various containers. This doesn't make any sense to me.

    If the documentation says that getItems() will return the items of the titlebar, and if I add three buttons, why am I not getting three buttons back?

    How can I get an array of the items (which are buttons) of a titlebar? I need to iterate through all the buttons in the titlebar and this seemingly simple task is turning out to be a nightmare.

    Thanks.

  2. ComponetQuery returns an array of components (not items).

    http://docs.sencha.com/touch/2-1/#!/...r-method-query

    Try:

    Code:
    myTitleBar.query('button');
    Good luck / E

  3. #2
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    194
    Answers
    23
    Vote Rating
    15
    EPV will become famous soon enough

      2  

    Default


    ComponetQuery returns an array of components (not items).

    http://docs.sencha.com/touch/2-1/#!/...r-method-query

    Try:

    Code:
    myTitleBar.query('button');
    Good luck / E

  4. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    148
    Answers
    12
    Vote Rating
    10
    pentool will become famous soon enough

      0  

    Default


    Eye doctor needed in isle four...eye doctor, isle four please!

    Oh, whoa! I don't know how could I possibly missed this. I've been up and down the methods and properties chart numerous times and I just didn't see it coming.

    Anyhow. Thanks a lot, that was EXACTLY I was looking for!

  5. #4
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    194
    Answers
    23
    Vote Rating
    15
    EPV will become famous soon enough

      0  

    Default


    That happens to the best of us.

  6. #5
    Sencha User
    Join Date
    Oct 2012
    Posts
    22
    Vote Rating
    0
    Morfi is on a distinguished road

      0  

    Default


    I was wondering if there is "query" that traverses upwards.

Thread Participants: 2

Tags for this Thread