Hybrid View

  1. #1
    Sencha Premium Member
    Join Date
    Mar 2010
    Location
    Nashville, TN
    Posts
    34
    Vote Rating
    1
    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 User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    570
    Vote Rating
    181
    Answers
    62
    Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold

      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 Premium Member
    Join Date
    Mar 2010
    Location
    Nashville, TN
    Posts
    34
    Vote Rating
    1
    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
    10
    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]