Initial row count is less than expected with Scroller and scrollCollapse enabled

Initial row count is less than expected with Scroller and scrollCollapse enabled

druegamerdruegamer Posts: 21Questions: 5Answers: 0

There appears to be an issue with scrollCollapse enabled that causes the number of rows to be loaded initially to be less than expected.

This appears to be a similar issue to the one described here: https://datatables.net/forums/discussion/31165/problem-with-initial-display-when-using-scroller-with-serverside-scrollcollapse

The following is a test case that reproduces the issue using the nightly builds: http://live.datatables.net/qopijexe/1

This appears to happen in both Firefox and IE11. For Chrome, this issue only occurs if the viewport is sufficiently small. About half the width of the table should work.

This has been tested on Chrome, Firefox, and IE11 in both CentOS 7 and Windows 7.

Replies

  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin

    Thanks for flagging that up - there does indeed appear to be an issue there. I'll post back once I've had a chance to look into it.

    Allan

  • druegamerdruegamer Posts: 21Questions: 5Answers: 0

    I've looked through the code and it seems as if scrollCollapse is being applied earlier than it should be, causing the number of rows to be displayed in the viewport to be miscalculated.

    I've included a patch that delays applying scrollCollapse until after initialization, which works in my testing.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @druegamer ,

    This has been resolved in the nightly builds and can be tested there - it will be included in the next Scroller release. Could you please retest with that nightly build and see if it fixes your specific issue. You can find the nightly releases here.

    Cheers,

    Colin

  • druegamerdruegamer Posts: 21Questions: 5Answers: 0

    I tested the nightly builds for both Datatables and the Scroller plugin and it does indeed appear to be fixed!

    I was looking through the source code to see how you guys went about addressing the issue. I couldn't find anything particularly trying to fix it but the addition of the new scroller label here: https://github.com/DataTables/Scroller/commit/86ffc8d9d41c65ecaaf9398b335bf6826c782301 seems to have inadvertently fixed it. I found in my testing that if I remove the styling of this element (the 'div.dts div.dts_label' block of css in the scroller plugin's css file) the issue arises again. My concern is that if this label feature or it's styling were to change we could see the issue again.

    Regards,
    druegamer

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @druegamer ,

    No, that's an old fix you posted - back from July. This is the fix here, and it is specific to this problem. A unit test has also been added so should it break (!) it would be caught in the future.

    Cheers,

    Colin

  • druegamerdruegamer Posts: 21Questions: 5Answers: 0

    I apologize for the long response time. End-of-cycle development has kept me busy for far too long.

    I can confirm that the fix addresses the issue in my local testing setup.

    Thank you very much!

This discussion has been closed.