ExtJs如何滚动到网格的底部? [英] ExtJs How do I scroll to the bottom of a grid?

查看:130
本文介绍了ExtJs如何滚动到网格的底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我希望将新的日志行添加到我的gridview的底部,因为它将cpu保存到不需要排序将其移动到网格顶部(加上我的同事更喜欢它)。



我的问题是,理想情况下,网格将滚动到底部添加新行后



我一直在查看文档,我无法弄清楚如何做到这一点。我只是看一个滚动到顶部的方法。



任何想法?



谢谢!

解决方案

使用GridView的 focusRow 方法,例如:

  myGrid.getView()focusRow(20)。 

如果您还没有行索引,则必须使用GridView的查找一行的相关方法。


I am making a web-based logviewer using extjs.

I would like new log-lines to be added to the bottom of my gridview as it saves cpu by not requiring a sort to move it to the top of the grid (plus its how my coworkers prefer it).

My problem is that ideally the grid would scroll to the bottom after a new row is added.

I have been looking through the documentation and I cannot figure out how to do this. I just see a method to scroll to the top.

Any ideas?

Thanks!

解决方案

Use GridView's focusRow method, e.g.:

myGrid.getView().focusRow(20);

If you don't already have the row index you'll have to retrieve it using one of GridView's related methods for finding a row.

这篇关于ExtJs如何滚动到网格的底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆