1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    17
    Vote Rating
    2
    ryancanulla is on a distinguished road

      0  

    Default Beginner Question. Custom component not showing up.

    Beginner Question. Custom component not showing up.


    Hi there,

    I have a beginner question. I have a controlle that should add some things to the screen. The issue is that my xtype: 'login' does not display but is created. Am I missing something?

    Code:
    Ext.Loader.setPath('Showcase', 'app');
    
    
    Ext.application({
    	name : 'Showcase',
    	controllers : ['LoginController'],
    	views : ['Login'],
    	autoCreateViewport : true,
    
    
    	launch : function() {
    		Ext.Viewport.add([{
    			xtype : 'login'
    		}]);
    	}
    })
    Code:
    Ext.define("Showcase.controller.LoginController", {
    	extend : 'Ext.app.Controller',
    
    
    	init : function() {
    		console.log("controller created");
    	}
    });
    Code:
    Ext.define('Showcase.view.Login', {
    	extend : 'Ext.Container',
    	xtype : 'login',
    
    
    	config : {
    		layout : 'vbox',
    		items : [{
    			xtype : 'container',
    			html : '<div align="center">Please make a selection</div>'
    		}, {
    			xtype : 'container',
    			html : '<div align="center">Please make a selection</div>'
    		}]
    	},
    
    
    	initialize : function() {
    		console.log("login created");
    	}
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    873
    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


    Have you inspected the DOM to see if your login container is rendered to the DOM? I would bet that it's just your child containers of your Login container just don't have heights. Use flex : 1 on your child containers to see if they show up.
    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.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    17
    Vote Rating
    2
    ryancanulla is on a distinguished road

      0  

    Default


    my issue was that I was overriding initialize and failed to implement callParent(arguments)

Thread Participants: 1