Expand/Collapse & Pagination

Expand/Collapse & Pagination

sanjussanjus Posts: 2Questions: 0Answers: 0
edited February 2010 in General
I have just starting (or rather exploring) using this tool & seems pretty impressive. However, in the example for Expand/Collapse http://datatables.net/1.5-beta/examples/api/row_details.html - when rows are expanded - the expanded rows are not counted in the number of rows to display & the pagination is not adjusted with the increased number of rows (expanded) or decresed number of rows (collapsed).

Any suggestions on how to achieve this?

TIA,
-sanju

Replies

  • allanallan Posts: 63,700Questions: 1Answers: 10,501 Site admin
    Hi sanju,

    The 'opened' row is considered to be a child row of the information row in DataTables, and therefore is not counted as part of the pagination. This is fairly core to the concept of fnOpen and fnClose in DataTables - so it might be a little tricky to work around. One option might be to change the value of '_iDisplayLength' whenever you open or close a row (found in the settings object, fnSettings). You would also need a callback on fnDrawCallback to take account of this - which is where the tricky part comes in. But is certainly possible.

    Regards,
    Allan
  • sanjussanjus Posts: 2Questions: 0Answers: 0
    Hi Alan,

    Thanks for the turbo-fast response.

    The expand/collapse functionality was which caught my attention - maybe in future releases this functionality is integrated with pagination as well.

    Except for this it seems to be the perfect & comprehensive library for almost everything that's out there that handles data tables/listing.

    -sanju
This discussion has been closed.