Custom pagination

Custom pagination

fookfook Posts: 5Questions: 0Answers: 0
edited February 2010 in General
I'm trying to build a pagination system like this:
[code]first previous next last [/code]

I've figured out how to customize my previous/next buttons in the css, but as soon as I apply
"sPaginationType": "full_numbers"

my custom buttons are removed. I need a way of customizing all buttons. I don't need the numbers. How can I do this? Any ideas?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    There is already a plug-in for four button pagination: http://datatables.net/plug-ins/pagination#four_button . It is applied something like this (which actually is showing a different plug-in): http://datatables.net/examples/plug-ins/paging_plugin.html . Can you build on that, or even is that what you need?

    Allan
  • fookfook Posts: 5Questions: 0Answers: 0
    This is great and is very close to what I need. I'm having a problem with it outputting the words "First Next Previous Last" over my pagination button images.

    I've tried using this:
    nFirst.innerHTML = "";
    nPrevious.innerHTML= "";
    nNext.innerHTML= "";
    nLast.innerHTML= "";

    but it removes my images too.

    Is there a way to disable the text but keep my button images?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Yup - just modify the plug-in to match you needs. The text is inserted using this (and following) lines: nFirst.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sFirst ) );

    You could use innerHTMl if you wanted, or not assign anything, or whatever :-)

    Allan
  • fookfook Posts: 5Questions: 0Answers: 0
    Awesome, thanks Alan. I got it working now.
This discussion has been closed.