1. #1
    Sencha User
    Join Date
    Aug 2010
    Location
    Fairfax, VA
    Posts
    19
    Answers
    1
    Vote Rating
    0
    Eric.Sencha is on a distinguished road

      0  

    Default Unanswered: Subclass working, Subclass of Subclass Bombing

    Unanswered: Subclass working, Subclass of Subclass Bombing


    The following renders ok:
    ===========================================================

    Code:
    Ext.ns('TestingNamespace');
    
    Ext.require( 'Ext.container.Viewport' );
    
    Ext.define('TestingNamespace.MyPanel',
    {
        extend: 'Ext.Panel',
        alias: 'widget.panel-my',
        requires:['Ext.Panel'], 
    });
    
    Ext.application(
    {
        name: 'TestingNamespace.TestingApplication',
        launch: function()
        {
            Ext.create('Ext.container.Viewport',
            {
                id: 'viewport',
    
                layout:
                {
                    type: 'fit'
                },
    
                items:
                [{
                    id: 'viewportInner',
                    region: 'center',
                    xtype: 'panel',
                    margins: '5',
    
                    layout:
                    {
                        type: 'fit'
                    },
    
                    items:
                    [{
                        id: 'panel',
                        xtype: 'panel-my',
                        bodyStyle: {'border-width': '1', 'background-color': 'lemonchiffon'}
                    }]
                }]
                })
        }
    });
    When i add the following everything bombs with no error messages:
    ===========================================================
    Code:
    Ext.define('TestingNamespace.MySubPanel',
    {
        extend: 'TestingNamespace.MyPanel',
        alias: 'widget.panel-my-sub',
        requires:['TestingNamespace.MyPanel'], 
    });
    The following does not render ok:
    ===========================================================
    Code:
    Ext.ns('TestingNamespace');
    
    Ext.require( 'Ext.container.Viewport' );
    
    Ext.define('TestingNamespace.MyPanel',
    {
        extend: 'Ext.Panel',
        alias: 'widget.panel-my',
        requires:['Ext.Panel'], 
    });
    
    Ext.define('TestingNamespace.MySubPanel',
    {
        extend: 'TestingNamespace.MyPanel',
        alias: 'widget.panel-my-sub',
        requires:['TestingNamespace.MyPanel'], 
    });
    
    Ext.application(
    {
        name: 'TestingNamespace.TestingApplication',
        launch: function()
        {
            Ext.create('Ext.container.Viewport',
            {
                id: 'viewport',
    
                layout:
                {
                    type: 'fit'
                },
    
                items:
                [{
                    id: 'viewportInner',
                    region: 'center',
                    xtype: 'panel',
                    margins: '5',
    
                    layout:
                    {
                        type: 'fit'
                    },
    
                    items:
                    [{
                        id: 'panel',
                        xtype: 'panel-my',
                        bodyStyle: {'border-width': '1', 'background-color': 'lemonchiffon'}
                    }]
                }]
                })
        }
    });
    ===========================================================
    Does anyone have an idea what is wrong with the subclass of a subclass in this particular example?

    I'm stuck :P

    Thanks.

    -Eric
    Attached Files
    Last edited by Eric.Sencha; 19 Jan 2012 at 9:31 AM. Reason: Added CODE tags, Attached Files

  2. #2
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      0  

    Default


    Please use [CODE] tags when posting code.

    You don't need the Ext.ns, that's done automatically by Ext.define.

    You also don't need to use requires to specify the superclass, that's implicit. Remove that from both of your classes.

    If that doesn't fix it...

    What ExtJS version are you using?

    Which JS file are you using? Dynamic loading on or off? Where is MySubPanel defined relative to the other code you've posted?

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Location
    Fairfax, VA
    Posts
    19
    Answers
    1
    Vote Rating
    0
    Eric.Sencha is on a distinguished road

      0  

    Default Answers to Skirtle's Questions

    Answers to Skirtle's Questions


    In response to Skirtle's Questions:

    Q: What ExtJS version are you using?

    A: ExtJS version: 4.0.7 in FireFox v9.0.1 (Apache 2.2.21 running on localhost)

    - httpRoot <http root folder for apache running on localhost>

    - app <folder>

    - Testing.html
    - Testing.js

    - extjs <folder>


    Q: Which JS file are you using?

    A: I have attached the files (.js and .html) in a .zip file to the original posting.

    Q: Dynamic loading on or off?

    A: I am not familiar with ExtJS dynamic loading yet (one of my next topics to tackle) however i believe i am not using dynamic loading (please see files now attached to original posting).

    Q: Where is MySubPanel defined relative to the other code you've posted?

    A: Directly below the definition for MyPanel (please see files now attached to original posting).

    Thanks for any help you can offer - i am missing something fundamental about handling classes in ExtJS I believe.

    -Eric

  4. #4
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      0  

    Default


    Using your code I get an error message in both Firefox and Chrome:

    "NetworkError: 404 Not Found - http://localhost/TestingNamespace/MyPanel.js?_dc=1327006980149"
    This is an attempt to dynamically load the file MyPanel. You're using ext-debug.js, which uses dynamic loading.

    However, it's not entirely clear to me why this doesn't work. It may be a bug.

    It is easily remedied if you switch from using ext-debug.js to ext-all-debug.js. You can switch back to using ext-debug.js once you're comfortable with dynamic loading and have files laid out accordingly.

  5. #5
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,639
    Answers
    33
    Vote Rating
    103
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Quote Originally Posted by Eric.Sencha View Post
    The following does not render ok:
    ===========================================================
    Code:
    Ext.ns('TestingNamespace');
    
    Ext.require( 'Ext.container.Viewport' );
    
    Ext.define('TestingNamespace.MyPanel',
    {
        extend: 'Ext.Panel',
        alias: 'widget.panel-my',
        requires:['Ext.Panel'], 
    });
    
    Ext.define('TestingNamespace.MySubPanel',
    {
        extend: 'TestingNamespace.MyPanel',
        alias: 'widget.panel-my-sub',
        requires:['TestingNamespace.MyPanel'], 
    });
    
    Ext.application(
    {
        name: 'TestingNamespace.TestingApplication',
        launch: function()
        {
            Ext.create('Ext.container.Viewport',
            {
                id: 'viewport',
    
                layout:
                {
                    type: 'fit'
                },
    
                items:
                [{
                    id: 'viewportInner',
                    region: 'center',
                    xtype: 'panel',
                    margins: '5',
    
                    layout:
                    {
                        type: 'fit'
                    },
    
                    items:
                    [{
                        id: 'panel',
                        xtype: 'panel-my',
                        bodyStyle: {'border-width': '1', 'background-color': 'lemonchiffon'}
                    }]
                }]
                })
        }
    });


    -Eric
    The above renders fine for me, a lemon colored body is what I get. A few weird things about the code though.

    No need to use 'requires' together with 'extend'. Ext knows it has to load the 'extend' class, so remove your 'requires'.

    You use layout 'fit' and specify 'region', seems like copy paste garbage?

  6. #6
    Sencha User
    Join Date
    Aug 2010
    Location
    Fairfax, VA
    Posts
    19
    Answers
    1
    Vote Rating
    0
    Eric.Sencha is on a distinguished road

      0  

    Default Still failing to render in Firefox, IE, Chrome

    Still failing to render in Firefox, IE, Chrome


    If I include :
    TestingNamespace.MySubPanel
    everything fails to render.

    if i subtract:
    TestingNamespace.MySubPanel
    everything renders - i never see any error messages....

    …totaly stymied

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar