dear
I am new to ext, I don't understand the difference between "renderTo", "applyTo" and "contentEl", the three config value, can use the node of dom, how situation for me to use it?
best regards
ives
Printable View
dear
I am new to ext, I don't understand the difference between "renderTo", "applyTo" and "contentEl", the three config value, can use the node of dom, how situation for me to use it?
best regards
ives
- renderTo renders the Component into the specified existing element.
- applyTo uses the specified alement as the main elementof the Component. A Component created using applyTo does not need rendering - its main element already exists.
- contentEl is only for Panels. It simply moves the specified element into the body of the Panel when the Panel is rendered to use... as the content!
i added the config "renderTo: Ext.get('tree-div')" and it just does not work. tree-div is the id of a div in a form in body of the page.
I am mixed up!
help me please.
use Ext.Element.get('tree-div')
Is this the body of a FormPanel? In that case you shouldn't be using renderTo at all!!!
Instead, you should be specifying the component as one of the items of the formpanel.
partial code below
var ImagePanel = new Ext.Panel({
id: 'images-view',
frame: true,
width: 500,
height: 1000,
autoHeight: false,
layout: 'auto',
align: 'middle',
title: 'View image',
bodyStyle:'overflow:visible',
bodyCfg:
{
tag: 'div',
cls: 'x-print-body' // Default class not applied if Custom element specified
},
bwrapCfg:
{
tag: 'div',
cls: 'x-print-bwrap' // Default class not applied if Custom element specified
},
items: [tbUsers,pagingbar,datav]
})
// create window
var win = new Ext.Window({
id:'imginform-win'
,width: 640
, cls: 'printer'
,height: 600
,modal: true
,layout:'fit'
,border:false
,closable:true
,renderTo:imagepop
,frame:true
,items:ImagePanel
});
//ImagePanel.render('imagepop');
win.show();