0
votes

I want to scroll to last row or selected item or rowIndex
I try some case like:

                grid.setScrollTop(rowIndex); // not working

                grid.getView().focusRow(rowIndex);// not working

                // not working
                var idx = this.getStore().indexOfId(rowIndex);
                var rowEl = this.getView().getRow(idx);
                rowEl.scrollIntoView(this.getGridEl(), false);

all of them are not working, how can i do that thanks

Edit:
I have a window include a gridpanel and when i add a new item i want scroll of window to last thanks
Edit 2:
see my example: http://jsfiddle.net/h9Dy9/ When i add some new items scroll of window must move to last or select items.

1
Are you using a buffered store? - Christoph
I try with local store (ArrayStore) and i don't init width or height for my gridpanel, I using autoScroll: true for my Ext.window.Window - DeLe

1 Answers

0
votes

Last row, it means the bottom of the grid right?

I tried to use this, and it works:

var scrollPosition = 100;   
YourGrid.getEl().down('.x-grid-view').scroll('bottom', scrollPosition, true);

I found this from Grid -scrollTo bottom