I am using a JQGrid which has a Jscrollpane inside it. The Grid has pagination to it.
When I select 10 or 20 records and after that I scroll down the grid, the scroller jumps to the top even if I scroll using the mousewheel plugin. It is always on top, it just won’t come down.
If I use normal scroll bars, everything works fine. I have tried maintainPosition:true and false but even then, the scroller is always on top.
gridComplete: function(){
var table_header = $('#gbox_list').find('.ui-jqgrid-hbox').css("position","relative");
$('#gbox_list').find('.ui-jqgrid-bdiv').bind('jsp-scroll-x', function(event, scrollPositionX, isAtLeft, isAtRight){
table_header.css('right', scrollPositionX);
}).jScrollPane({
showArrows: true,
autoReinitialise: true,
horizontalDragMaxWidth: 30,
verticalDragMaxHeight: 30,
maintainPosition:false
});
},
Keep using the scrollbar and try selecting 5///10///20 records… You will notice the error.
Everytime the content gets changed, I need the scrollbar to be on the top as well as to the left when reinitialized.
I did 3 things to get this working.
jScrollPanewas not initializing from inside jqGrid’sgridCompletefunction so I moved it to the end of the script.jScrollPaneagainst$('div.ui-jqgrid-bdiv').autoReinitialise: true.Put this at the end of your script and comment out the contents of
gridComplete.