Articles in this section
Category / Section

How to get the scroll top of the content in TreeGrid

1 min read

In tree grid, with virtualization enabled mode the actionComplete client-side event will be triggered on scroll action with requestType event argument as scroll. In this event, we can get the current scroll top position of the tree grid content using the scroller object. please refer the following code example for this.

//app.component.html
<ej-treegrid #TreeGridControl id="TreeGridContainer" 
//… 
enableVirtualization = "true" (actionComplete) = "actionComplete($event)" > 
</ej-treegrid> 

 

//app.component.ts
actionComplete(args) {
         if (args.requestType == "scroll") {
            var treeObj = this.treeGrid.widget;
            var scrollTop = treeObj.getScrollElement().ejScroller("scrollTop");
            this.scrollValue = scrollTop;
          }
        }

The below screenshot shows the output of above code example.

Current scroll top value of treegrid content using scroller object.

Sample to get the current scroll top of the tree grid content is available here.

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied