agGride主动操作滚动条滚动到底部

阅读 192

2022-03-16

1. 业务场景:

     可编辑表格,新增编辑项后滚动条滚动到底部看到最后一项新增数据。

2. 方法

 const ht = document.getElementsByClassName("ag-body-viewport ag-layout-normal ag-row-no-animation")
      ht.forEach((item) => {
        item.scroll({
          top: item.scrollHeight,
          left: 0,
          behavior: "smooth" //滚动条平滑滚动
        });
      })

精彩评论(0)

0 0 举报