PDA

View Full Version : I want to render 'viewport' to an element on my page,how can do it?



zoluro
14 Mar 2012, 8:47 PM
I want to render 'viewport' to an element on my page,how can do it?
In fact, i found that the config(renderTo:'div1') do not work.It always (app:ds:always) render to body,why?
Thanks

Erikvip
14 Mar 2012, 10:02 PM
You can't, a Viewport represents the entire visible area in the browser, and it always attaches itself to document.body.

See the docs on the viewport renderTo config:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.container.Viewport-cfg-renderTo (http://docs.sencha.com/ext-js/4-0/#%21/api/Ext.container.Viewport-cfg-renderTo)


renderTo : String/HTMLElement/Ext.Element
Not applicable. Always renders to document body.

It sounds like what you're after is the layout option, or a different layout manager. Take a look at the layouts example:

http://dev.sencha.com/deploy/ext-4.0.0/examples/layout-browser/layout-browser.html

zoluro
25 Mar 2012, 7:44 PM
All right ,Thanks!