Results 1 to 4 of 4

Thread: Override of container renderTpl results in ownerCt is null

    You found a bug! We've classified it as EXTJS-9655 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    8
    Vote Rating
    0
      0  

    Default Override of container renderTpl results in ownerCt is null

    REQUIRED INFORMATION Ext version tested:
    • Ext 4.2.0.663

    Browser versions tested against:
    • FF20(firebug 1.11.2 installed)
    • chrome 25

    Description:
    • If you override the renderTpl an error is thrown, ownerCt is null and prevents proper
      sizing of the container. This worked in 4.0.x and 4.1.x.

    Steps to reproduce the problem:

    The result that was expected:
    • No error thrown

    The result that occurs instead:
    • ownerCt is null error

    Test Case:
    Code:
         Ext.define( 'app.container',{
        extend: 'Ext.container.Container',
        renderTo : Ext.getBody(),
        initComponent: function() {
            var me = this;
    
            Ext.apply(me, {
                id: "login-container",
                minHeight: 510,
                renderTpl: new Ext.XTemplate('<div id="login-panel">',
                '<div class="brand-image"></div>',
                '<div class="login-image"></div>',
                '<div class="title-form-container">',
                    '<h1>{title}</h1>',
                    '<div id="login-form-container"></div>',
                    '<span class="error" style="visibility: hidden;"></span>',
                '</div>',
                '<div class="copyright">',
                    '{copyright}',
                '</div>',
            '</div>'),
                renderData: {
                    title:"application",
                    copyright: "copyright",
                    version: "version"
                },
                renderSelectors: {
                    formContainerEl: '#login-form-container',
                    errorEl: '#login-container .error'
                }
            });
            me.callParent(arguments);
        }
    });
    
    Ext.create('app.container', {renderTo:  Ext.getBody()});
    HELPFUL INFORMATION

    See this URL for live test case: http:// Debugging already done:
    • none

    Possible fix:
    • not provided

    Additional CSS used:
    • only default ext-all.css
    • custom css (include details)

    Operating System:
    • Ubuntu 12.10/13.04
    • Windows 7

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,154
    Vote Rating
    247
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

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

    Default

    There's a few problems with the test case:

    1) There's only very rare circumstances where you should (or need to) change the renderTpl, the internal implementation of components rely on certain things being there.
    2) You're extending Ext.container.Container, but not using any of the features of a container, just rendering markup.
    3) Changing the renderTpl doesn't actually achieve anything, since you're rendering content, not structure, you can use the tpl property:

    Code:
      Ext.define( 'app.container',{
        extend: 'Ext.Component',
        id: "login-container",
        initComponent: function() {
            var me = this;
    
            Ext.apply(me, {
                minHeight: 510,
                tpl: new Ext.XTemplate('<div id="login-panel">',
                '<div class="brand-image"></div>',
                '<div class="login-image"></div>',
                '<div class="title-form-container">',
                    '<h1>{title}</h1>',
                    '<div id="login-form-container"></div>',
                    '<span class="error" style="visibility: hidden;"></span>',
                '</div>',
                '<div class="copyright">',
                    '{copyright}',
                '</div>',
            '</div>'),
                data: {
                    title:"application",
                    copyright: "copyright",
                    version: "version"
                },
                renderSelectors: {
                    formContainerEl: '#login-form-container',
                    errorEl: '#login-container .error'
                }
            });
            me.callParent(arguments);
        }
    });
    
    Ext.onReady(function(){
        
        
        var ct = Ext.create('app.container', {
            renderTo:  Ext.getBody()
        });
        console.log(ct.formContainerEl, ct.errorEl);
        
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    8
    Vote Rating
    0
      0  

    Default

    Hi Evant
    Thanks for the quick response, I've applied the changes you suggested.

Posting Permissions

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