View Full Version : no scroll() in Core3.x ?

18 Jun 2010, 6:57 AM
I'm confused.
I've read in Ext Core 3.0 Api -Documentation:

scrollTo (http://www.sencha.com/products/core/docs/source/Element.scroll.html#method-Ext.Element-scrollTo)( String side, Number value ) : ElementScrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it ...
Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking,use scroll().I'm looking for this function in the code with no success. Is it true that there is no scroll() for the Ext.Element available like in Extjs3.xx? :(

18 Jun 2010, 7:17 AM
Correct. It's defined in Element.scroll-more.js, which is not included in ext-core.js.

18 Jun 2010, 7:30 AM
HI Condor,
thanks for replying.
I there a way to get those functionallity to Core 3. I tried :

scroll : function(direction, distance, animate){
var el = this.dom,
l = el.scrollLeft, t = el.scrollTop,
w = el.scrollWidth, h = el.scrollHeight,
cw = el.clientWidth, ch = el.clientHeight,
scrolled = false, v,
hash = {
l: Math.min(l + distance, w-cw),
r: v = Math.max(l - distance, 0),
t: Math.max(t - distance, 0),
b: Math.min(t + distance, h-ch)
hash.d = hash.b;
hash.u = hash.t;

direction = direction.substr(0, 1);
if((v = hash[direction]) > -1){
scrolled = true;
this.scrollTo(direction == 'l' || direction == 'r' ? 'left' : 'top', v, this.preanim(arguments, 2));
return scrolled;


18 Jun 2010, 7:34 AM
You could simply include Element.scroll-more.js to get a working scroll methods.

(but you would be mixing GPL and MIT code - is that a problem?)

18 Jun 2010, 8:27 AM
Yes, thank you, I will try it. The licening stuff is not a problem in the moment. I only wish to figure out, if I could replace jQuery with Ext Core without a lack of functionallity and comfort. And therefore I tried to translate some simple functions from jQuery
to Ext.Core. But it seems that I miss some basic features (e.g animated scrolling) in Ext Core?? :-(

18 Jun 2010, 10:35 AM
I've included the Element.scroll-more.js but my little Script won't run.


scrollToAnchor: function(t, s, e, d) {
var off = (d !== undefined)? d: 20;

var anc = this.select('a[name='+t+']').first();
var distance = anc.getY();
var opt = {
duration: s || 2,
easing: e || 'easeOutStrong',
scope: this
var dir;
if(distance >= 0) {
dir = 'b';
}else {
dir = 't';
distance = this.dom.scrollTop;
// alert(distance);
this.scroll(dir, distance, opt);
return this;
})the var anc is always '0' therefore I think it depence on the select-command.
Nevertheless everything goes fine when I include Extjs 3.2 instead Ext Core3!

Any ideas?

18 Jun 2010, 11:55 AM
Why is my last posting not published?
I've got a message, that my posting is in a proofing process by a Moderator?
For me it is a brand new habit in this forum! Pretty strange!!:-/

Haste makes waste! ;-)