Results 1 to 6 of 6

Thread: ComponentQuery with advanced attribute selector

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3115 in 2.4.1.
  1. #1
    Sencha Premium Member
    Join Date
    Jan 2009
    Posts
    25
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    118
    Vote Rating
    9
      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
    19
      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
      1  

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •