angular-tree-control icon indicating copy to clipboard operation
angular-tree-control copied to clipboard

Determining when user has scrolled to bottom of editor

Open dekhaus opened this issue 8 years ago • 1 comments

Hi All

I have an Ace editor instance that I want to progressively load the contents of by making repeating calls to my back-end - in order to provide an 'infinite scroll' like user experience. In order to implement this I need to be able to determine when a user has scrolled to the bottom of the editor - aka when the vertical scrollbar is all the way at the bottom of the vertical scroll 'region'.

How can this be accomplished ?

Thanks Dave

dekhaus avatar Jul 07 '16 03:07 dekhaus

I figured out a solution.

Since I'm incrementally loading the data I know how many lines of data I'm loading in each 'chunk'. I then use the 'getLastVisibleRow()' method to determine if the user has scrolled to the last row in the last 'chunk' of data loaded. Works great ...

var indexOfLastRow = editor.getLastVisibleRow()

Dave

dekhaus avatar Jul 07 '16 21:07 dekhaus