You found a bug! We've classified it as a bug in our system. We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #11
    Sencha User
    Join Date
    May 2008
    Location
    Germany
    Posts
    19
    Vote Rating
    3
    vpopa is on a distinguished road

      0  

    Default


    Quote Originally Posted by westy View Post
    If you have more than one alias for a class you can only query by the first one, for example.
    This explains why Ext.ComponentQuery.query('grid') doesn't work and I must do a Ext.ComponentQuery.query('gridpanel') to get the grid. Ext.grid.Panel has 2 aliases: ['widget.gridpanel', 'widget.grid'] and gridpanel is the first.

    This is strange because the docs for CQ states that "Components can be retrieved by using their xtype" and grid is the xtype not gridpanel.

  2. #12
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    198
    Vote Rating
    1
    Nickname is on a distinguished road

      0  

    Default


    Any news on the "internal review" ?

  3. #13
    Sencha User
    Join Date
    Apr 2007
    Posts
    79
    Vote Rating
    4
    Artur Bodera (Joust) is on a distinguished road

      0  

    Default


    I've just crashed on this one. Here's a fiddle for you to check out the bug.

    http://jsfiddle.net/Thinkscape/UwCcx/

    Also - the .dot aliasing works with everything else in controller: models, stores, views, ie:
    Code:
     models: ['stats.Combined','stats.Sources','stats.Products','stats.Brands'],
     stores: ['stats.Combined','stats.Sales'],
     views: ['stats.grid.ClickViews','stats.chart.Sales', 'stats.chart.Conv'],
    This means, there is only the
    Code:
    refs:{}
    (componentquery) that's got a problem with it.

  4. #14
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    198
    Vote Rating
    1
    Nickname is on a distinguished road

      0  

    Default


    *push*

  5. #15
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    198
    Vote Rating
    1
    Nickname is on a distinguished road

      0  

    Default


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.0.2a
    • since preview
    Browser versions tested against:
    • FF4.0.1 (firebug 1.7.3 installed) Ubunutu 10.10
    • 12.0.742.91 (87961) Ubuntu 10.10
    Description:
    • Ext.ComponentQuery.query() for itemId's / xtypes containing "." (dot) not working
    Steps to reproduce the problem:
    • Create a custom grid and use as alias name something with a "." like "widget.my.gridpanel"
    • Try to use Ext.ComponentQuery.query() on that alias

    The result that was expected:
    • The result should contain an array with the references to the initiated instances of that custom grid with the custom alias

    The result that occurs instead:
    • its returning an empty array

    Test Case:

    PHP Code:
    var cn = function() {  // for demo, reduce LOC
        
    console.info('Contructor: ' this.alias);
        
    this.callParent(arguments);
    }

    Ext.define('Namespace.Panel', {
        
    extend'Ext.panel.Panel',
        
    alias'widget.alias.with.namespace.panel',
        
    constructorcn
    });

    Ext.define('Namespace_Panel', {
        
    extend'Ext.panel.Panel',
        
    alias'widget.alias_no_namespace_panel',
        
    constructorcn
    });

    nsPanel = new Namespace.Panel();
    // prints "Contructor: widget.alias.with.namespace.panel"
    no_nsPanel = new Namespace_Panel();
    // prints "Contructor: widget.alias_no_namespace_panel"

    console.log(Ext.ComponentQuery.query('.alias.with.namespace.panel'));
    // return empty array => []
    console.log(Ext.ComponentQuery.query('.alias_no_namespace_panel'));
    // return  1 element => correct 
    HELPFUL INFORMATION


    Debugging already done:
    • Sencha Developer "evant" opened Bug Id EXTJSIV-1804 and wanted to start a discuions if dots in alias names are allowed
    • a) Whether CQ will support the "convenience" aliases
      b) Whether we'll support periods in xtypes

    Possible fix:
    • Sencha should update this ticket, what the internal review has produced
    Operating System:
    • Ubuntu 10.10



    Sorry, a bit sarcasm here, but Bug its open since 6. May and since 13.May the "internal review" started.
    I want to know if dot-alias querieing is coming or should I get used to use non-dotted aliases and remove all //FIXME from my code
    Last edited by Nickname; 29 Jun 2011 at 11:03 AM. Reason: added bug id and format

  6. #16
    Sencha User
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    198
    Vote Rating
    1
    Nickname is on a distinguished road

      0  

    Default


    Another 4 weeks without response

    *push*

  7. #17
    Ext JS Premium Member SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    312
    Vote Rating
    9
    SebTardif will become famous soon enough

      0  

    Default


    +1 We were hit by the same bug. I believe all MVC applications are likely to be hit by this since this is very natural to use alias with dot.

  8. #18
    Sencha User
    Join Date
    May 2008
    Posts
    45
    Vote Rating
    0
    codeart.ch is on a distinguished road

      0  

    Default


    I use

    Code:
    Ext.ComponentQuery.query('[xtype="ca.management.user.FormPanel"]')
    its not so nice as '.ca.management.user.FormPanel' but it works

  9. #19
    Ext JS Premium Member SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    312
    Vote Rating
    9
    SebTardif will become famous soon enough

      0  

    Default


    ComponentQuery match also subclasses when using the normal syntax. I doubt the [xtype=...] mechanism also support that.

  10. #20
    Sencha User charris's Avatar
    Join Date
    Sep 2010
    Location
    Brooklyn, NY
    Posts
    106
    Vote Rating
    13
    charris will become famous soon enough

      0  

    Default


    Fantastic--not only does this work, but I might prefer it since the query criteria is explicit (i.e., it's obvious that the search will be based on the xtype attribute of DOM elements). Thanks for sharing.

    Quote Originally Posted by sxxl View Post
    I use

    Code:
    Ext.ComponentQuery.query('[xtype="ca.management.user.FormPanel"]')
    its not so nice as '.ca.management.user.FormPanel' but it works

Similar Threads

  1. Ext.ComponentQuery.query() not working
    By ashish01 in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 7 Sep 2012, 4:45 AM
  2. Replies: 1
    Last Post: 24 Jul 2012, 12:57 PM
  3. Ext.ComponentQuery.query() only creates an empty array
    By Reggae in forum Ext: Discussion
    Replies: 5
    Last Post: 24 May 2011, 4:09 AM
  4. [OPEN-EXTJSIV-1804]Ext.ComponentQuery xtype
    By rchloupe in forum Ext:Bugs
    Replies: 0
    Last Post: 30 Apr 2011, 12:00 PM
  5. [OPEN-759] Ext.ComponentQuery.query() Epic Fail!
    By gcallaghan in forum Sencha Touch 1.x: Bugs
    Replies: 0
    Last Post: 3 Feb 2011, 5:50 PM

Thread Participants: 16