PDA

View Full Version : Unable to add textfield to a toolbar, me.el is null error



anilcs0405
5 Aug 2012, 9:29 PM
Hi All,
I am trying to add a textfield to a toolbar. Following is the code I have and I am trying to add the toolbar to the north panel of my layout.
When I try to render this I am getting the following error TypeError: me.el is null.
If I remove the textfield from the toolbar the screen renders propertly. Am I missing anything basic?


window.onload = function(){
Ext.create('Ext.container.Viewport', {
layout: 'border',
renderTo: Ext.getBody(),
items: [{
region: 'north',
height: 24,
border: false,
tbar: [{
xtype: 'textfield'
}, {
text: 'Button'
}]
}, {
region: 'west',
collapsible: true,
title: 'Navigation',
width: 150
// could use a TreePanel or AccordionLayout for navigational items
}, {
region: 'south',
title: 'South Panel',
collapsible: true,
html: 'Information goes here',
split: true,
height: 100,
minHeight: 100
}, {
region: 'east',
title: 'East Panel',
collapsible: true,
split: true,
width: 150
}, {
region: 'center',
xtype: 'tabpanel', // TabPanel itself has no title
activeTab: 0, // First tab active by default
items: {
title: 'Default Tab',
html: 'The first tab\'s content. Others may be added dynamically'
}
}]
});
}

Thanks,
Anil

evant
5 Aug 2012, 9:33 PM
Other than it not being in an onReady block, I don't see anything wrong with that. I ran your code against 4.1.1 and there was no error.