Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    6
    Vote Rating
    0
    Chris.Schick is on a distinguished road

      0  

    Default TabPanel loader only works for first tab

    TabPanel loader only works for first tab


    Hello,

    The following used to work with 4.0.0 but with 4.1.0 only the first tab contains content. All other tabs remain empty.

    Code:
    new Ext.window.Window({
        "autoShow": true,
        "constrain": true,
        "height": 480,
        "id": Ext.id(),
        "items": [{
            id: "srcTabPnl",
            items: [{
                "autoScroll": true,
                "closable": false,
                "loader": {
                    autoLoad: true,
                    success: function () {
                        Sunlight.highlightAll();
                    },
                    url: "StaticContent/Source/Index/Index.htm",
                    xtype: "tab"
                },
                "scripts": true,
                "title": "Index.cshtml",
                "xtype": "tab"
            }, {
                "autoScroll": true,
                "closable": false,
                "loader": {
                    autoLoad: true,
                    url: "StaticContent/Source/Index/HomeController.htm",
                    xtype: "tab"
                },
                "title": "HomeController.cs",
                "xtype": "tab"
            }, {
                "autoScroll": true,
                "closable": false,
                "loader": {
                    autoLoad: true,
                    url: "StaticContent/Source/Shared/SourceWindow.htm",
                    xtype: "tab"
                },
                "title": "SourceWindow.cs",
                "xtype": "tab"
            }, {
                "autoScroll": true,
                "closable": false,
                "loader": {
                    autoLoad: true,
                    scripts: true,
                    url: "StaticContent/Source/Index/TreeData.htm",
                    xtype: "tab"
                },
                "title": "IndexTreeData.js",
                "xtype": "tab"
            }, {
                "autoScroll": true,
                "closable": false,
                "loader": {
                    autoLoad: true,
                    scripts: true,
                    url: "StaticContent/Source/Index/IndexSrc.htm",
                    xtype: "tab"
                },
                "title": "Index.js",
                "xtype": "tab"
            }],
            listeners: {
                tabchange: {
                    fn: function () {
                        Sunlight.highlightAll();
                    }
                }
            },
            xtype: "tabpanel"
        }],
        "layout": "fit",
        "maximizable": true,
        "title": "Source View",
        "width": 790
    })
    Last edited by Chris.Schick; 4 May 2012 at 7:58 PM. Reason: formatting

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,917
    Vote Rating
    630
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    xtype: 'tab' is not the correct component to use. 'tab' refers to a component that extends Ext.button.Button.

    Instead, you want something like:

    Code:
    Ext.require('Ext.picker.Color');
    Ext.onReady(function() {
        
        Ext.create('Ext.tab.Panel', {
            renderTo: document.body,
            width: 400,
            height: 400,
            defaultType: 'component',
            items: [{
                title: 'Tab 1',
                loader: {
                    autoLoad: true,
                    url: 'content1.json'
                }
            }, {
                title: 'Tab 2',
                loader: {
                    autoLoad: true,
                    url: 'content2.json'
                }
            }]
        })
        
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    6
    Vote Rating
    0
    Chris.Schick is on a distinguished road

      0  

    Default


    Ah my bad, thanks for letting me know.

Thread Participants: 1

Tags for this Thread