Results 1 to 7 of 7

Thread: [FIXED]Floating components have no ownerCt property/floatParent is not documented

    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. #1
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    33
    Vote Rating
    0
      0  

    Default [FIXED]Floating components have no ownerCt property/floatParent is not documented

    I have created a component which extends Ext.Component and set the "floating" attribute to true.

    I need to get a reference to the container of the component so I can call getEl() on the container. I am trying to do this in onRender, but when that override is called ownerCt has been deleted!

    The framework saves a reference to ownerCt in "floatParent" but that property isn't documented and I'm not sure if I should be using it.

    Is this a documentation bug, framework bug, or my bug? If there is a guide for creating floating components please let me know.

    Thanks for your time!

    Justin

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,816
    Vote Rating
    904
      0  

    Default

    Small test case:

    Code:
    Ext.onReady(function() {
        
        var c = Ext.create('Ext.Component', {
            floating: true,
            html: 'Foo!',
            width: 100,
            height: 100
        });
        
        Ext.create('Ext.panel.Panel', {
            width: 400,
            height: 400,
            renderTo: document.body,
            items: c    
        });
        c.show();
        
        console.log(c.ownerCt);
    });
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    53
      0  

    Default

    Yes, this does need documenting.

    I'll add some documentation about what's going on.

    A floating Component cannot really have an ownerCt because there are upward links from layout managers which use the ownerCt to rearrange the ownerCt when the child changes size.

    So a different reference is kept for floating Components, and that's floatParent. Well done on digging it all up yourself in the absence of docs!
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    33
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by Animal View Post
    A floating Component cannot really have an ownerCt because there are upward links from layout managers which use the ownerCt to rearrange the ownerCt when the child changes size.

    So a different reference is kept for floating Components, and that's floatParent.
    Maybe a "container" property that figures out which reference to return is appropriate? Then application code doesn't have to check if a component is floating or not.

    Thanks for the response!

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    53
      0  

    Default

    I've just spent a good while composing some hopefully coherent and meaningful prose to describe the ins and outs of floating Components. It should make the next release of the lib and docs.
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  6. #6
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    33
    Vote Rating
    0
      0  

    Default In PR4?

    Did your write up make it into PR4? I'd love to read it.

  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    53
      0  

    Default

    Didn't make it into PR4. You should see it soon though.
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

Similar Threads

  1. Replies: 1
    Last Post: 19 Mar 2011, 11:54 AM
  2. Cannot read property 'ownerCt' of undefined
    By qbert65536 in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 23 Sep 2010, 3:42 PM
  3. [CLOSED] Panel's renderer property not documented
    By grubi in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 24 Aug 2010, 10:31 AM
  4. component ownerCt property always undefined ..
    By wtfowned in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 27 Jul 2008, 8:01 AM
  5. [Ext2.0_rc1] Ext.Toolbar and missing 'ownerCt' property
    By pic_Nick in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 27 Nov 2007, 9:55 PM

Posting Permissions

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