gpt4 book ai didi

javascript - dGrid 表格以编程方式水平滚动

转载 作者:行者123 更新时间:2023-11-30 14:25:19 24 4
gpt4 key购买 nike

dGrid 中是否有一种方法可以让您滚动到表中的特定列,我有一个可以水平滚动的表,我想知道是否有可能执行类似的操作:

myGrid.scrollToColumn(someColumnToScrollTo);

我知道我可以垂直滚动到某一行,是否有类似的东西可以满足我的需要?

最佳答案

正如 kfranqueiro(Dojo 1.x 提交者和 dgrid 维护者)所说:

https://github.com/SitePen/dgrid/issues/360

Firstly, there is a scrollTo method on dgrid instances, which you can pass an object with x or y properties to scroll in a platform-agnostic manner

还是他,他在这里使用那个函数:

https://github.com/SitePen/dgrid/issues/1279

grid.scrollTo({ y: index * grid.get('rowHeight') })

你需要传递 x 而不是 y 和你需要的偏移量而不是 index * grid.get('rowHeight')

关于javascript - dGrid 表格以编程方式水平滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52034818/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com