mkoryak/floatThead

Window scrolling performance issue

magnumheart opened this issue · 6 comments

Hi @mkoryak ,

I'm using this plugin for window scrolling a table that contains configurable number of columns,
but the scrolling is handled by <div id="content"> rather than the window itself.

There is a noticeable performance lag issue when scrolling the table with plenty of columns.
I'm currently reflowing the table each time the div scroll event is called:
$('#content').scroll(function () { $('table').trigger('reflow'); });

I just like to know if there is a way to improve performance by updating the code where the scroll event for window scrolling is handled in the base js file?
If yes, could you kindly walk me through which section of the code to be updated.

Thanks for the awesome plugin!

Have you tried the scrollContainer option ?

Please supply a jsfiddle

I tried scrollContainer and it improved the scrolling performance compared to reflowing everytime the <div> scrolls.
Sorry I missed that option, thanks for pointing that out.

Sorry, one more question.
What if I have two <div> that handles overflow x and y separately?

If I use scrollContainer for <div class="overflow-y">, it cuts the width of the floating thead when there are multiple columns exceeding window width.

<div class="overflow-y">
  <!-- other content -->
  <div class="overflow-x">
    <table>
  </div>
</div>

I did end up modifying the code base.
I added a new option similar to scrollContainer that I called innerContainer,
then I replaced some instances of $scrollContainer that I assumed related to calculating the floated table width.
I just don't know if I missed some, but everything seemed to work fine for me, just some minor bugs I found and fixed already.

Cheers!

lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.