various pagination questions
various pagination questions
rainierwolfcastle
Posts: 2Questions: 0Answers: 0
Hi. I'm thinking of using this plugin to redesign a ticket-request system at work but I have a few questions relating to pagination. Mainly, how can you turn off pagination completely? Having said that, turning it off and then deleting a row several pages down seems to cause a redraw of the entire table, which means focus jumps to the top of the page again, which isn't ideal. The only reason I wanted to turn off pagination was to just have a plain table and the user can scroll up and down. If I use pagination, then it would be great to have it detect (somehow) the height of the page and show as many rows as the table can show, and it would adjust rows to page automatically.
Lots of wishes here, I guess. Can't hurt to ask :-) Great plugin even if I can't get it to bend to my wishes, though. One of the best table plugins out there.
Lots of wishes here, I guess. Can't hurt to ask :-) Great plugin even if I can't get it to bend to my wishes, though. One of the best table plugins out there.
This discussion has been closed.
Replies
Lots of good questions :-) - I think probably all possible (with varying degrees of implementation difficulty of course ;-) ).
So pagination - to disable us the bPaginate parameter: http://datatables.net/usage/features#bPaginate . You can also see this in action here: http://datatables.net/examples/basic_init/filter_only.html .
When you delete the row which is causing the focus jump, are you using fnDeleteRow()? I don't know of anything that would cause the focus to jump, but certainly DataTables does to a redraw - what you could do is disable this with one of the options passed to fnDeleteRow and then remove the node from the DOM yourself.
Regarding the new page scrolling options - I like this idea! This could be done by using the document's height, and calculate the visible height of the rows on the screen. This could then be wrapped up in a DataTables pagination plug-in: http://datatables.net/plug-ins/pagination :-). Requires a little bit of programming though.
Regards,
Allan