Responsive vs Scroller+scrollCollapse

Responsive vs Scroller+scrollCollapse

bp9109bp9109 Posts: 2Questions: 1Answers: 0

Link to test case: http://live.datatables.net/qayalaji/1/edit

Is there a way to get responsive's child rows' slideUp/slideDown to take precedence over scroller's scrollCollapse? We use a datatable where each row has extra columns hidden in a child row details section. When I try to use Scroller with scrollCollapse=true, and the search returns only one row, the datatable naturally shrinks down to just 1 row tall. The problem is when you expand the child rows the table's viewable height doesn't get any bigger. It gives you a tiny up/down arrow on the right to scroll through the additional rows slowly making each one visible in the 1 row tall viewable window.

Without scrolling, using paging, the viewable window expands to fit the child rows when you slideDown. I've tried figuring out how to get scrollCollapse to do the same, but I'm not much of an expert at this yet.

I had partial success doing a scroller.measure() after each slide. It works ok in the cases of 1-2 results, but with a large dataset like 3000 rows each slide up/down takes 5-6 seconds to render.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    Answer ✓

    Is there a way to get responsive's child rows' slideUp/slideDown to take precedence over scroller's scrollCollapse?

    No, sorry. With Scroller enabled all rows in the table body must be of equal height, and there cannot be any other elements in the table body.

    The reason for this is that Scroller performs its position calculations based on the knowledge that there are X rows in the table and they are of Y height. Therefore we can calculate the position of any row in the table (although we do it in a non-linear fashion to allow for the fact that elements can't have infinite height).

    Any interruption to that calculation would mean Scroller's calculation needs to take into account extra information and thus becomes more complicated and slower. We've not gone down that route.

    Allan

  • bp9109bp9109 Posts: 2Questions: 1Answers: 0

    Thanks for the info. I'll pop it out in a modal or something.

This discussion has been closed.