PDA

View Full Version : how can i adjust scrollbar position with a Ext.ContentPanel



snowway
26 Apr 2007, 9:22 PM
hi.
I have a problem with using Ext.ContentPanel. I want to make the scrollbar of ContentPanel to scroll to the bottom when the content is full.

the layout code is:

...
center:{
autoScroll:true,
fitToFrame:true
}
..

How can i do that?can anyone help me?

soad
26 Apr 2007, 10:33 PM
One of the ways is to do it programmatically. Here is the code that scrolls to the bottom:



var el = panel.getEl(); // panel is an instance of Ext.ContentPanel
el.dom.scrollTop = el.dom.scrollHeight;


You have to add this snippet to your initialization code.

HTH