Component "renderTo" Config Option

By Vitaliy on March 15, 2012. ExtJS 4.0.7
2600
Specify the id of the element, a DOM element or an existing Element that this component will be rendered into. 

Notes: Do not use this option if the Component is to be a child item of a Container. It is the responsibility of the Container's layout manager to render and manage its child items. When using this config, a call to render() is not required. 

Reply to this thread Panel loader problem

Js Code

Ext.widget('panel', {
	//using id is a bad practise
	id: 'panel1',
	title: 'panel 1',
	width: 200,
	height: 200,
	renderTo: 'output'
});
Ext.widget('panel', {
	title: 'panel 2',
	width: 100,
	height: 100,
	//render to other component with id='panel1'
	renderTo: 'panel1'
});
Ext.widget('panel', {
	title: 'panel 3',
	width: 200,
	height: 200,
	margin: '5 0 0 0',
	renderTo: 'output',
	html: '<div id="parent"><div>'
});
Ext.widget('panel', {
	title: 'panel 4',
	width: 100,
	height: 100,
	//render to html element with id='parent'
	renderTo: 'parent'
});