Articles in this section
Category / Section

How to move the scrollbar to a selectedRow in TreeGrid?

1 min read

In jQuery TreeGrid, we can able to move the scrollbar to selected row while selecting any row (at load time using selectedRowIndex property or changing the row selection on button click action) by using the rowSelected client-side event and updateScrollBar method. The below code example explains about how to select the row using setModel and how to move the scrollbar to selected row.

<div id="TreeGridContainer" style="height:400px;width:100%"></div>
    <button id="click" onclick="clickme()" style="margin-top:10px;">Move ScrollBar</button>
<script type="text/javascript">
$(function () {
            $("#TreeGridContainer").ejTreeGrid({
                      //
                rowSelected: function (args) {
                    this. updateScrollBar();
                },
                dataSource: projectData,
            })
        });
        function clickme() {
            var treeObj = $("#TreeGridContainer").data("ejTreeGrid");
            treeObj.setModel({ "selectedRowIndex": 30 });
        }
</script>

 

Update the scrollbar while select a row at load time.

 

A Sample to move the scrollbar to a selected row is available in the following link, Sample

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