Results 1 to 3 of 3

Thread: Beginner Question. Custom component not showing up.

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    17
    Vote Rating
    2
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    17
    Vote Rating
    2
      0  

    Default

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

Posting Permissions

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