-
3 Feb 2010 4:13 AM #1
Auto scroll a grid to a specific row
Auto scroll a grid to a specific row
Hi,
I have a gridPanel containing an Store which includes a date column. The grid is sorted in date ascending order by default. I'd like to automatically scroll the grid to the row closest to today's date. I have found that the following both work in the FB console:
but I can't work out what event to listen for in order to fire one of the above. It seems that neither listening for the load event of the store or the render event on the grid work.Code:grid.getView().focusRow(x); Ext.getCmp('theGrid').getView().scroller.dom.scrollTop = y
I must be doing something wrong. Could someone help?
Thanks
-
3 Feb 2010 5:42 AM #2
Use the viewready event.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
3 Feb 2010 6:16 AM #3
OK, listen for 'viewready' on the GridPanel; makes sense except I can't get it to fire. I'm using version 2.2.1 and although I can find it in the 3.1 docs it doesn't appear under the GridPanel class in the 2.2.1 docs. Is it actually implemented in 2.2.1? Or is there something wrong with my implementation?
ThanksCode:var mygrid = new Ext.grid.GridPanel({ store : this.store, height : 300, width : 500, stripeRows : true, listeners : { viewready: function(grid){ console.log(grid); } } });
-
3 Feb 2010 6:32 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 28
Please post in the *help* section in the future with these types of questions.
Moved to help.
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
3 Feb 2010 8:40 AM #5
It's a 3.* event
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642


Reply With Quote