PDA

View Full Version : Beginner Question. Custom component not showing up.



ryancanulla
1 Feb 2012, 7:13 AM
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?



Ext.Loader.setPath('Showcase', 'app');


Ext.application({
name : 'Showcase',
controllers : ['LoginController'],
views : ['Login'],
autoCreateViewport : true,


launch : function() {
Ext.Viewport.add([{
xtype : 'login'
}]);
}
})




Ext.define("Showcase.controller.LoginController", {
extend : 'Ext.app.Controller',


init : function() {
console.log("controller created");
}
});




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");
}
});

mitchellsimoens
1 Feb 2012, 9:14 AM
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.

ryancanulla
1 Feb 2012, 12:31 PM
my issue was that I was overriding initialize and failed to implement callParent(arguments)