PDA

View Full Version : how to update scroller



Chris26
3 Mar 2011, 3:10 AM
Hi,

i have dynamically growing/shrinking textareas in a formpanel. The problem is that the scroller of the surrounding formpanel does not get updated correct.

how can i update the scroller?

thanks!
Chris

Chris26
4 Mar 2011, 1:30 AM
this is my grow/shrink function and i call it on keyup for the textarea.


utils.grow = function(ta) {
var textarea = ta.fieldEl.dom;

textarea.style.height = textarea.style.lineHeight;

ta.fieldEl.setHeight(textarea.scrollHeight);
ta.setHeight(textarea.scrollHeight);
}now i think i have to update the bounds of the scroller of the textareafield surrounding formpanel...

(the scroller is only broken if the textarea gets higher than one screenheight)

fvarona
4 Mar 2011, 1:58 AM
Hello.

I'm not sure, but maybe if you do a doLayout() or doComponentLayout() in the surrounding object...

Regards,

FranV

Chris26
4 Mar 2011, 2:29 AM
i tried that already, it is not working, but thanks!

Chris26
7 Mar 2011, 1:39 AM
any other ideas?

miroperez
7 Mar 2011, 8:25 PM
I ran into an issue with a dataview when it was scrolled down towards the bottom then if you refreshed the data the scroll didn't go to the top so you didn't see anything after that (because it's stuck at the top). This is what I had to do because I didn't see an api to reset the scroll:



var scrollEl = this.dataView.scrollEl;
Ext.DomHelper.applyStyles(scrollEl, "-webkit-transform: translate3d(0px, 0px, 0px)");


Inspect around the formpanel dom for something with the above -webkit-tranform. Hope this helps.

keckeroo
17 Aug 2011, 3:43 PM
Better fix is discussed here

http://www.sencha.com/forum/showthread.php?122707-OPEN-749-Dataview-scroll-to-top&highlight=dataview+scroll