DataTables Scroll question.

DataTables Scroll question.

Upsetti_SpaghettiUpsetti_Spaghetti Posts: 10Questions: 5Answers: 0

Is it possible to use the ScrollY effect but set the height depending on how many rows you want to be shown like in pagination?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921

    Is the solution described in this blog about the scrollResize.js plugin what you are looking for?

    Kevin

  • Upsetti_SpaghettiUpsetti_Spaghetti Posts: 10Questions: 5Answers: 0

    Not exactly but thank you! I was looking something more along these lines.
    Table Picture As you can see it the user could decide how many items would be visible on the first load then scroll at their hearts delight.

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921
    edited February 2020 Answer ✓

    Seems like you can use the same plugin but instead of the Click and drag me! element you can adjust the height of the container using jQuery height(). You will need to do some calculations to set the container height but the scrollResize.js plugin should handle the rest.

    Here is a simple example:
    http://live.datatables.net/buzuzotu/4/edit

    Kevin

  • Upsetti_SpaghettiUpsetti_Spaghetti Posts: 10Questions: 5Answers: 0

    Oh fantastic, thank you very much!

This discussion has been closed.