Results 1 to 3 of 3

Thread: TabPanel loader only works for first tab

    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
      0  

    Default 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 User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,002
    Vote Rating
    936
      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'
                }
            }]
        })
        
    });
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    6
    Vote Rating
    0
      0  

    Default

    Ah my bad, thanks for letting me know.

Tags for this Thread

Posting Permissions

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