如何在jqgrid中使用jScrollPane? [英] How to use jScrollPane with jqgrid?
本文介绍了如何在jqgrid中使用jScrollPane?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在jqgrid中使用JScrollPane?我尝试使用它,但标头没有移动.这是我的代码.
How to use JScrollPane with jqgrid? I tried to use it but the headers are not moving. Here is my code.
gridComplete:function(){
$('#gview_mygrid >div.ui-jqgrid-bdiv').jScrollPane({ showArrows: true, scrollbarWidth: 17, arrowSize: 17, scrollbarMargin: 0 });}
推荐答案
最后我弄清楚了. 这是工作代码. 在标记中
Finally I figured it out.. Here is the working code. In the markup
<div id="container" >
<table id="list"><tr><td/></tr></table>
<div id="pager"></div>
</div>
在Java脚本中,我们还必须绑定标题(.ui-jqgrid-hbox类)才能滚动
IN Java script, We have to bind the header (class .ui-jqgrid-hbox) also to scroll
gridComplete:function(){
var table_header = $('#container').find('.ui-jqgrid-hbox').css("position","relative");
$('#container').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
});
}
这篇关于如何在jqgrid中使用jScrollPane?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文