This is a migrated thread and some comments may be shown as answers.

Data Source Update Resets Grid Scollbar

1 Answer 792 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Blake
Top achievements
Rank 1
Blake asked on 06 Dec 2013, 07:10 AM
It appears that when you call options.success within the success callback of the Data Source Update, it will reset the grid scollbar to the top.  For example, if I scroll down several records and edit a record, the scrollbar will jump back to the top rather than staying where it was.  Is there a way to keep the scrollbar from jumping back to the top?

success: function(result) {
    // notify the data source that the request succeeded
    options.success(result);
}

Thanks,
Blake

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 09 Dec 2013, 12:56 PM
Hi Blake,

Is the grid navigable option enabled? You may consider disabling it if appropriate. Otherwise, you will need to persist the scroll position yourself. Here is a basic implementation: 

dataSource.bind("requestStart", function(e) {
  if (e.type === "update") {
    var grid = $("#grid").data("kendoGrid");
    var scrollTop = grid.content[0].scrollTop;
    grid.one("dataBound", function() {
      grid.content[0].scrollTop = scrollTop;
    });
  }
});


Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Blake
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or