1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    249
    Answers
    2
    Vote Rating
    1
    Ex_Soft is an unknown quantity at this point

      0  

    Default Answered: How to add TabPanel into Viewport

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Answers
    3500
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1