Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    12
    Vote Rating
    3
    rixo is on a distinguished road

      0  

    Default [OPEN-1377] findParentBy and findParentByType methods are broken in CompositeField

    [OPEN-1377] findParentBy and findParentByType methods are broken in CompositeField


    Ext version tested:
    • Ext 3.3.0

    Adapter used:
    • ext

    Test Case:

    Code:
    Ext.create({
        xtype: "form"
        ,items: [{
            xtype: "compositefield"
            ,items: [{
                xtype: "textfield"
                ,id: "bebe"
            }]
        }]
    });
    
    Ext.getCmp("bebe").findParentByType("form"); // => null, instance of FormPanel expected
    Debugging already done:
    • In its initComponent method, CompositeField puts its children items in its innerCt property. So, the children's ownerCt property references the innerCt container, instead of the CompositeField. Furthermore, the innerCt container is never added to its parent CompositeField, nor any other container, with the add() method; it is only rendered with innerCt.render(ct), in the onRender method of CompositeField.

      As a consequence, the findParentBy method of CompositeField's children items can only access the innerCt, and then it cannot continue any upper in the containers hierachy.

    Possible fix:

    Code:
    // Fixes the broken findParentBy method of CompositeField's children items
    Ext.form.CompositeField.prototype.initComponent = 
    	Ext.form.CompositeField.prototype.initComponent.createSequence(function(){
    
    	if (!this.innerCt.ownerCt) {
    		this.innerCt.ownerCt = this;
    	} else {
    		// The bug has been fixed in this version of Ext, this hack is no longer needed
    		debugger;
    	}
    });

  2. #2
    Sencha User
    Join Date
    Jan 2010
    Posts
    50
    Vote Rating
    0
    Allbus is on a distinguished road

      0  

    Default


    I also have troubles using findParentByType with CompositeField items.

    Can Ext team confirm this is a bug?

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    83
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    This is a known issue (this report is probably a duplicate).

  4. #4
    Sencha User
    Join Date
    Jan 2010
    Posts
    50
    Vote Rating
    0
    Allbus is on a distinguished road

      0  

    Default


    Will this be fixed? When?

  5. #5
    Ext JS Premium Member
    Join Date
    Mar 2010
    Location
    Moldova, Republic of / Shelton, CT, US
    Posts
    136
    Vote Rating
    3
    amsoft is on a distinguished road

      0  

    Default


    Still no news? Thanks.

Similar Threads

  1. findParentBy/findParentByType
    By DaveC426913 in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 1 Nov 2010, 9:36 AM
  2. [OPEN-1324] Error in CompositeField's documentation
    By devnullable in forum Ext 3.x: Bugs
    Replies: 0
    Last Post: 13 Oct 2010, 2:13 AM
  3. Replies: 6
    Last Post: 16 Sep 2010, 1:38 AM
  4. Replies: 0
    Last Post: 20 May 2010, 11:25 PM
  5. Replies: 0
    Last Post: 20 May 2010, 12:45 PM

Thread Participants: 3