PDA

View Full Version : Adding a Panel to a page



kumarshah
18 Jul 2009, 7:29 PM
I am trying to add a Panel to a page, but am having problems with the default x-type being undefined. The current code is:




var

ct =new Ext.Panel({


renderTo:'bindform',


frame:true,


title:'Book List',


width:540,


height:400,


layout:'fit',


items:

{

id:'detailPanel',





region:'center',

bodyStyle:{




background:'#aaaaaa',


padding:'7px'


},

html:'Please select a User'




}


})



With this code I get the

types[config.xtype || defaultType] is not a constructor
error.


So I guess I am missing a pre-requisite step to adding the Panel. How would I go about doing this?


Thanks
Kumar

elishnevsky
18 Jul 2009, 8:17 PM
region:'center' is only for border layout. Try removing it.

kumarshah
18 Jul 2009, 8:21 PM
region:'center' is only for border layout. Try removing it.

Same error after removing it.

elishnevsky
18 Jul 2009, 8:31 PM
Works fine for me. The problem is somewhere else in your code.

kumarshah
18 Jul 2009, 8:36 PM
Works fine for me. The problem is somewhere else in your code.

I have a grid already rendered on the page when I am trying to do that. I guess that is causing a problem.