You found a bug! We've classified it as TOUCH-3115 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Jan 2009
    Posts
    25
    Vote Rating
    0
    wirtsi is on a distinguished road

      0  

    Default ComponentQuery with advanced attribute selector

    ComponentQuery with advanced attribute selector


    Hi ...

    bit more of a RFE instead of a bug ... but what really bugs me, is that I can't query components that have multiple attributes. For example

    Code:
    {
       xtype:'container',
       cls: 'overlay-footer',           
       items:[
           {
                html: 'Imprint',
                cls: 'overlay-footer-item overlay-footer-imprint',                   
           }
       ]
    }
    Now I want to query the imprint container. This one works

    Code:
    Ext.ComponentQuery.query('.container[cls="overlay-footer-item overlay-footer-imprint"]')
    This one doesn't

    Code:
    Ext.ComponentQuery.query('.container[cls="overlay-footer-imprint"]')
    Ok, makes sense ... according to http://www.w3.org/TR/CSS2/selector.html this would be the way to do it

    Code:
    Ext.ComponentQuery.query('.container[cls~="overlay-footer-imprint"]')
    Am I missing something or is this not supported?

    Bests

    wirtsi

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


    I would say this is a feature request as it has never intended to work. I have a draft that I will see what the cor devs think for possible inclusion into 2.1.0
    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.

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    118
    Vote Rating
    9
    Bunchofstring will become famous soon enough

      0  

    Default


    ...or you could create and use a (custom) "pseudo" selector until that feature is added.
    http://docs.sencha.com/touch/2-0/#!/...ComponentQuery
    Last edited by Bunchofstring; 12 Jul 2012 at 10:05 AM. Reason: Added shortcut to docs

  4. #4
    Sencha User mberrie's Avatar
    Join Date
    Feb 2011
    Location
    Bangkok, Thailand
    Posts
    506
    Vote Rating
    14
    mberrie will become famous soon enough mberrie will become famous soon enough

      0  

    Default


    Is this gonna make it into ExtJs as well?

    And what syntax will be supported? cls="myclass" or cls*="myclass" or..?

    I think this really should be supported. It is a fairly obvious and common use-case.

    So thx for pushing this, mitchell!

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    72
    Vote Rating
    3
    TDeBailleul is on a distinguished road

      1  

    Default Any progress ?

    Any progress ?


    Has there been any progress regarding this topic ?

    I have the same config as the OP and neither ~= nor *= works using 2.1

    Has it been included in Sencha Touch 2.1

  6. #6
    Sencha User
    Join Date
    Nov 2010
    Posts
    8
    Vote Rating
    0
    sfreeman is on a distinguished road

      0  

    Default


    No luck for me in 2.1 either and don't see anything in the source when I step through it that'd accomplish this.