当网格已经排序时,我想要scrollIntoView记录。这就是我要用的:
onSort: function(event) {
event.onComplete = function () {
w2ui.grid.scrollIntoView(10);
}
}发布于 2016-05-27 07:49:49
你需要延迟scrollIntoView()
https://jsfiddle.net/zxcgxkxa/1/
onSort: function(event) {
event.onComplete = function () {
setTimeout(function(){
w2ui.grid.scrollIntoView(10);
}, 10);
};
}因为在执行grid.sort()之后,w2grid将在内部执行grid.refresh(),后者在内部执行延迟滚动:
setTimeout(function () { // allow to render first
obj.resize(); // needed for horizontal scroll to show (do not remove)
obj.scroll();
}, 1);https://stackoverflow.com/questions/37477052
复制相似问题