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.
Sample to get the current scroll top of the tree grid content is available here.