Giter Club home page Giter Club logo

Comments (9)

jakebair avatar jakebair commented on July 2, 2024

I also experienced the same issue. Reverting to 1.2.0 solved this issue for me.

from scroller.

 avatar commented on July 2, 2024

I've just been looking into this a bit more. When Scroller is activated it calculated the height of the table rows to it can perform its positional calculations. However, if you initialise it in a hidden element, then there is no height that can be calculated!

I've replicated this in a little test case here:

Note that the table appears to be empty (it does actually have data, as do your own, but because the row height is 0, you can't see it!).

The fix is to have Scroller calculate the row height when the tab is made visible. The row height in Scroller can be recalculated through use of the scroller().measure() API method that Scroller adds to the DataTables API. My little test case shows the problem being resolved using that method here:

I've recently come up with an idea for how this requirement to call an API method can be resolved. There are details on a recent blog post here:

The only downside that I can see at the moment is that IE requires a solid background colour for the table using that method. Otherwise it paints a border around the table that simply cannot be removed...

from scroller.

prog8 avatar prog8 commented on July 2, 2024

Any news here? I have the same problem. Evenscroller().measure() doesn't work. Scroller causes oSettings._iDisplayLength to be NaN so I cannot even fetch correct portion of data from my backend. Any idea how to solve it?

from scroller.

 avatar commented on July 2, 2024

scroller().measure() should work when the table is visible. If is doesn't please open a support thread with a link to a test case showing the issue so it can be debugged.

from scroller.

prog8 avatar prog8 commented on July 2, 2024

OK, so the question is why it worked in 1.2.0 and doesn't work in 1.2.2 (I mean without scroller().measure)

from scroller.

prog8 avatar prog8 commented on July 2, 2024

When I used _fnCalcRowHeight method body from 1.2.0 in 1.2.2 things seem to work fine. Do you have any explanation for this?

from scroller.

 avatar commented on July 2, 2024

Can you link to a test case showing the issue so I can debug it please. That way I might be able to explain and correct the issue.

from scroller.

prog8 avatar prog8 commented on July 2, 2024

More precisely the problem is in small difference

In 1.2.0 _fnCalcRowHeight had something like that in code:

container.appendTo( 'body' );

1.2.2 has:

container.appendTo( appendTo );

And this part seems to be causing problems.

from scroller.

 avatar commented on July 2, 2024

Fixed in 43ddcf4 (I forgot to reference this bug in the commit message).

If the table is hidden it will now insert into the body like 1.2.0 did. It isn't perfect, but it will help with the majority of cases!

from scroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.