Results 1 to 6 of 6

Thread: [CLOSED]Component.ref does not work anymore

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member htammen's Avatar
    Join Date
    Jul 2010
    Location
    Germany, Hannover
    Posts
    74
    Vote Rating
    0
      0  

    Default [CLOSED]Component.ref does not work anymore

    has the config option ref of class Component been removed?
    In Ext 3.3 I used this technique to get a reference to a component quite frequently because it produces much more readable code.
    Is this available in Ext 4.0 or will it come back?

  2. #2
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    72
    Vote Rating
    0
      0  

    Default

    It have been replaced with ComponentQuery, see aconran's post here: http://www.sencha.com/forum/showthre...8-Ref-Property
    -

  3. #3
    Ext JS Premium Member htammen's Avatar
    Join Date
    Jul 2010
    Location
    Germany, Hannover
    Posts
    74
    Vote Rating
    0
      0  

    Default

    thank you. Ive already seen this new class but it makes the code more unreadable than
    PHP Code:
    Ext.getCmp('myId').on(...) 
    In Ext 3.3 I used
    PHP Code:
    this.myId.on(...) 
    and with ComponentQuery it would be
    PHP Code:
    Ext.ComponentQuery.query('#myId')[0].on(...) 
    Decide by yourself which on is most readable. I hope the guys from Sencha read this and reconceive their decision to remove the ref config option.

  4. #4
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,970
    Vote Rating
    931
      0  

    Default

    Code:
    // for direct child
    this.child('selector').on(....);
    
    // for first matching child, any level
    this.down('selector').on();
    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.

  5. #5
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676
    Vote Rating
    9
      0  

    Default

    i think ref was not a bad idea, however you had to know the level of the component.
    There was already a discussion, and i hope to get something like referenced items in a component for easy assign.
    Easy would be a wrapper for ComponentQuery like this.getChildComponent(selector) - i prefer such for better readability, and to be different from DOM queries. At the end it's also a kind of taste.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  6. #6
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,970
    Vote Rating
    931
      0  

    Default

    @steffenk

    Those methods are there. Container has:
    query
    child
    down

    Component has:
    up
    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.

Similar Threads

  1. Posts edit seems do not work anymore.
    By AndreaCammarata in forum Community Discussion
    Replies: 3
    Last Post: 31 Jan 2011, 10:42 AM
  2. add(Component) does not work anymore with 0.99
    By konki_vienna in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 5 Nov 2010, 7:37 PM
  3. [CLOSED][3.1] <Component>.add(<Panel>) doesn't work
    By wceuppens in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 21 Dec 2009, 5:01 AM
  4. adobe air 1.5 released - SWFUpload does not work anymore
    By bjt in forum Ext.air for Adobe AIR
    Replies: 2
    Last Post: 2 Dec 2008, 6:08 AM

Tags for this Thread

Posting Permissions

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