How to implement the react antd table scroll bar event

how to implement the react antd table scroll bar event

there is a table table in the project development that needs to be loaded lazily

scroll bar event, that is, when the vertical scroll bar of table reaches the bottom, it triggers the ajax event to get a certain number of pieces of data.

Jul.12,2021

you can try onScrollCapture snooping

something like this

<div className={styles.center} onScrollCapture={() => this.onScrollEvent()} ref={c => (this.container = c)}>
...
</div>
constructor(props) {
    super(props);
    this.onScrollEvent = this.onScrollEvent.bind(this);
  }

  onScrollEvent() {
    if (this.container.scrollTop + this.container.clientHeight ===         
      this.container.scrollHeight) {
      // todo
    }
  }
Menu