1. #1
    Sencha User
    Join Date
    Mar 2010
    Location
    Nashville, TN
    Posts
    28
    Vote Rating
    0
    malkandari is on a distinguished road

      0  

    Default Unanswered: Ext.ComponentQuery.query

    Unanswered: Ext.ComponentQuery.query


    I'm trying to use Ext.ComponentQuery.query to query for a window title, apparently it does not like the comma in the title.

    Example
    Ext.ComponentQuery.query('window[title="Google, Inc"]');

    Error

    Ext.Error: Invalid ComponentQuery selector: "[title="Google"

    Does anyone know a solution around that?

    Thank You,

  2. #2
    Sencha Premium Member Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Delaware
    Posts
    494
    Vote Rating
    48
    Answers
    55
    Tim Toady has a spectacular aura about Tim Toady has a spectacular aura about Tim Toady has a spectacular aura about

      0  

    Default


    Comma is used a delimeter between different selectors. Use a selector that doesn't use a comma. itemId perhaps?

    IMO, it is an Ext bug in this instance.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Location
    Nashville, TN
    Posts
    28
    Vote Rating
    0
    malkandari is on a distinguished road

      0  

    Default


    I'm using a grid that lists companies and when you click on a company's name is Ext.create a window for it. The reason I'm using Ext.Com.Query and look for the title is because if it exists then I don't have to load it but instead bring it to the front of other windows. Windows do not open in modal true. You can open 4 different windows at the same time.

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    GER
    Posts
    8
    Vote Rating
    0
    Answers
    1
    m.k is on a distinguished road

      0  

    Default


    You could strip the special characters from the title and store it in a different property (itemId?) of your Window instance and use this property for ComponentQuery.

    Since you are only interested in Windows, why bother ComponentQuery with filtering by xtype. I would rather use this code:
    Code:
    var window=Ext.WindowManager.getBy(function(win){return win.title==='My, Title, containing, Comma';})[0]