PDA

View Full Version : How to prevent the page scrolling to the label that I just updated?



l0rraine
28 Feb 2014, 12:09 AM
I have a counter in a page that is a little long.
When I updated some label's text, the page just scrolled to the position of the label.
So the user cant read the page at all, for the page keep scrolling.
Here is some detail. the definition of the label


{
xtype: 'label',
itemId: 'staytime',
border: false,
margin: '0 10'
}

I use this code to update the label's text. the "me" is the panel and the "count" works fine


me.on('render', function () {
Ext.util.TaskManager.start({
run: function () {
me.count++;
me.down('#staytime').update(me.count+' seconds');
},
interval: 1000,
scope: me
});
});

yes, all works fine, just the page will scroll to the "staytime" label.
Is it can be avoided or I have done something wrong?
Any help is appreciated.

slemmon
13 Mar 2014, 11:53 AM
Hi,

Can you share a test case that demonstrates the issue? I'm not seeing the same issue when I test, but perhaps I've not captured the use case very well.

You can share a test case at https://fiddle.sencha.com if you'd like.

My attempt:

48s