How to use jScrollPane with jqgrid?

谁说我不能喝 提交于 2019-12-12 01:09:47

问题


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 });}

回答1:


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>

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           
                        });
                     }


来源:https://stackoverflow.com/questions/13505536/how-to-use-jscrollpane-with-jqgrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!