various pagination questions

various pagination questions

rainierwolfcastlerainierwolfcastle Posts: 2Questions: 0Answers: 0
edited August 2009 in General
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.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi,

    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
  • rainierwolfcastlerainierwolfcastle Posts: 2Questions: 0Answers: 0
    Thanks for the responses. I was thinking of deleting a row from the DOM myself as well. Haven't had time to implement my ideas, but I'm also thinking/hoping of finding a way to have the row fade in and out, so that when new items should be displayed, space is gradually made (animated) then the new row would fade in. Of course, laziness might also win the day, but I can dream :-) Thanks again.
This discussion has been closed.