Results 1 to 2 of 2

Thread: How to add TabPanel into Viewport

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    249
    Answers
    2
    Vote Rating
    3
      0  

    Default Answered: How to add TabPanel into Viewport

    I've tried:

    app.js
    Code:
    Ext.Loader.setConfig({
        enabled: true
    });
    
    Ext.application({
        name: "Test",
    
        appFolder: "app",
    
        controllers: [
            "TestTabPanel"
        ],
    
        launch: function () {
            Ext.create("Test.view.Viewport", {
            });
        }
    });
    Viewport.js
    Code:
    Ext.define("Test.view.Viewport", {
        extend: "Ext.container.Viewport",
        layout: "fit",
        items: [
            {
                xtype: "testtabpanel"
            }
        ]
    });
    TestTabPanel.js
    Code:
    Ext.define("Test.controller.TestTabPanel", {
        extend: "Ext.tab.Panel",
        alias: "widget.testtabpanel",
        items: [
            {
                title: "Tab# 1"
            }, {
                title: "Tab# 2"
            }
        ],
    
        init: function () {
        },
    
        onLaunch: function () {
        }
    
    });
    Why should I add empty init and onLaunch?

  2. Your Test.controller.TestTabPanel extends Ext.tab.Panel. Your controllers should extend Ext.app.Controller and your views should use the Test.view namespace. Your controllers have to at least have the init method. It looks like you are trying to have a view act as a controller and view which is invalid.

  3. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,062
    Answers
    3976
    Vote Rating
    1391
      0  

    Default

    Your Test.controller.TestTabPanel extends Ext.tab.Panel. Your controllers should extend Ext.app.Controller and your views should use the Test.view namespace. Your controllers have to at least have the init method. It looks like you are trying to have a view act as a controller and view which is invalid.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

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