2013-06-25 82 views
0

我想滾動到最後一行或所選項目或rowIndex位置
我試着像一些情況:ExtJS的 - 滾動到最後一行(所選項目)

   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); 

所有的人都沒有工作,我怎麼能做到這一點感謝

編輯:
我有一個窗口包括GridPanel中,當我添加一個新的項目,我想窗口的滾動到最後感謝
編輯2:
看到我的例子:http://jsfiddle.net/h9Dy9/當我添加一些新的項目滾動窗口必須移動到最後或選擇項目。

+0

? – Christoph

+0

我嘗試使用本地存儲(ArrayStore),我沒有初始化我的網格面板的寬度或高度,我使用autoScroll:true爲我的Ext.window.Window – freestyle

回答

0

最後一行,它表示網格的底部是正確的?

我試圖用這個和它的工作原理:

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

我是否使用了緩衝存儲區中找到這個從Grid -scrollTo bottom