简体   繁体   English

剑道网格自动滚动

[英]Kendo grid automatically scroll

I am trying to auto scroll my grid into last added data. 我正在尝试将网格自动滚动到最后添加的数据中。 I extract this https://www.npmjs.com/package/kendo-grid-scroll . 我提取了这个https://www.npmjs.com/package/kendo-grid-scroll I call it in my dataBound method and do it like that 我在我的dataBound方法中调用它并像这样

var kendoGridScroll = new KendoGridScroll.Model(e.sender, function(grid, row) {
    grid.select(row); //do whatever you want 
});

Finally in this line i get such error 最终在这一行我得到这样的错误

$grid.data is not a function $ grid.data不是函数

Do you know why it happend or you know any diffrent way to do auto scrroling kendo grid? 您知道为什么会发生这种情况吗,或者您知道任何其他方式来自动编辑剑道网格吗?

Here is trick of how to scroll down a grid to its bottom: 这是如何向下滚动到网格底部的技巧:

var scrollGridDown = function() {
    var content = $(grid.element).find(".k-scrollbar").get(0);

    content.scrollTop = content.scrollHeight;
};

Demo 演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM