Can we apply SlimScroll or PerfectScrollbar plugin to jQuery Datatable default vertical scroll

。_饼干妹妹 提交于 2019-12-23 05:27:57

问题


I am using Datatable ver 1.10, I enable the vertical scrolling. now datatable showing window default scroll style.

Is it possible to change/implement some other scrollBar on datatable scrollbar? to make it more beautiful and fancy.

I tried this solution at stackoverflow but it squeez the header. also I want header and footer fixed position.


回答1:


here is my working code

// when initialization is completed then apply scroll plugin
"fnInitComplete":function(){
    $('.dataTables_scrollBody').perfectScrollbar();
},

//apply scroll on this height
"scrollY": 450,

//on paginition page 2,3.. often scroll shown, so reset it and assign it again 
"fnDrawCallback": function( oSettings ) {
    $('.dataTables_scrollBody').perfectScrollbar('destroy').perfectScrollbar();
},


来源:https://stackoverflow.com/questions/37031084/can-we-apply-slimscroll-or-perfectscrollbar-plugin-to-jquery-datatable-default-v

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