PDA

View Full Version : howto set Ext.view.View scroll bar position



foobarr
12 Dec 2011, 9:29 AM
using Ext 4.0.7. Ext.grid.Panel seems to reset the scroll bar to the "top" when the it's store is refreshed. I also want this behavior for Ext.view.View. How can I re-position the scroll bar of a view.View when it's store's data changes?

Thanks.

mitchellsimoens
12 Dec 2011, 12:36 PM
Something like this?


view.el.scrollTo('top', 0, false);

foobarr
14 Dec 2011, 7:32 AM
view.el.scrollTo('top', 0, false); // did not work for me

Looked at Ext.view.View docs, did not find 'el' under config list.


view.getEl().scrollTo('top', 0, false); // did not work for me


Found solution:
gave the view's first record a unique dom id, then, after refreshing
the view's store:

Ext.getDom('firstViewRecordId').scrollIntoView(view.getEl());