Results 1 to 4 of 4

Thread: 6.5.3 Classic: Ext.ComponentQuery.query('#autogenerated_id') returns an empty array

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jul 2015
    Posts
    11

    Default 6.5.3 Classic: Ext.ComponentQuery.query('#autogenerated_id') returns an empty array

    https://stackoverflow.com/questions/...empty-array-if

    I have some ExtJs component. I set itemId for it, but id is autogenerated.
    Now Ext.getCmp('autogenerated-id') returns my component. But Ext.ComponentQuery.query('#autogenerated-id') returns an empty array.
    It seems like itemId config property hides autogenerated id from Ext.ComponentQuery, so they become mutually exclusive.cmp-query.png

    It this a bug or a feature, where can I to find any info?

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    It seems like itemId config property hides autogenerated id from Ext.ComponentQuery, so they become mutually exclusive.
    Pretty much this. The itemId takes precedence. If you want a component by id only, use getCmp.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User
    Join Date
    Jul 2015
    Posts
    11

    Default

    So itemId just eliminates autogenerated id from ComponentQuery search even if itemId and id are different.
    It is not about just precedence, it is about elimination
    Where can I find any info on this behaviour in docs?
    Did you found an answer in ExtJS sources ? What source what string number ?

  4. #4
    Sencha User
    Join Date
    Jul 2015
    Posts
    11

    Default

    `Ext.ComponentQuery.query('[id=assets-information-form-1918]')` also returns my component.
    So probably the deal in "#" only.

Similar Threads

  1. Replies: 5
    Last Post: 22 Sep 2019, 6:41 AM
  2. [CLOSED] Ext.ComponentQuery.query returns components that does not exists on the DOM
    By rafaelreuber in forum Ext JS 6.x Bugs
    Replies: 2
    Last Post: 15 Aug 2015, 8:12 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

Posting Permissions

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