Access numbers indicating currently displayed rows

Access numbers indicating currently displayed rows

nwickinwicki Posts: 21Questions: 8Answers: 0

I am looking for a way to access what rows are currently displayed (to eventually export only them with pdf button or similar) when using scrollCollapse and scroller or scrollY. When using scrollY alone I have not found a way to do so. But when we use scroller, it calculates what rows are currently displayed and displays that information in the table info. So, I am currently using this to solve my problem, but it is rather ugly and seems to be more of a workaround because I could not find the api to access that information.

I built a jsfiddle for demonstration purposes: https://jsfiddle.net/smk4185n/43/.

If you were to activate the pdf button, it will only download the currently displayed rows.
But as I said I would rather have a different way of accessing the table info displaying what rows are shown. I thought I could do so using using the page.info() api with fields start and end, but it seems these are numbers for the start and end of loaded data?

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    You can use selector-modifier for that, page: 'current', see example here.

    Colin

  • nwickinwicki Posts: 21Questions: 8Answers: 0

    Some time passed since I last checked this forum. Sorry for the delay.

    I looked over your example and as I understand it, it only solves the case where we use normal pagination. It does not work for the case where we use scrolling.

    I incorporated it in the fiddle from the above post as shown here https://jsfiddle.net/fruq6nmb/2/.

    The idea is to only export the entries shown in the view of the scrolling window.

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    That is correct, we currently don't provide any way to limiting selection of rows to just those that are in the visible viewport of a scrolling table.

    Allan

This discussion has been closed.