Software Developer Software Developer - 2 months ago 22
jQuery Question

jqgrid - horizontal scrollbar - position - after paging - from left to right

Consider the following scenario:

JqGrid is loaded.

Since data is wide, it has horizontal scroll bar.

scroll to right.

Now, click on next page(paging)

Next page is displayed.

But the scroll bar is in right side, that is from where at previous page the scroll bar position maintains.

Our requirement is to have the scroll bar at left after paging independent of previous page scroll bar positions.

I searched over the net and not found any article / demo for this scenario. Thanks.


You can set scrollLeft of bDiv inside of onPaging for example. The corresponding code could looks like in simplified form as the following:

onPaging: function () {
    var bDiv = this.grid.bDiv;
    setTimeout(function () {
        bDiv.scrollLeft = 0;
    }, 0);