full numbers as plugin

full numbers as plugin

valdezrvaldezr Posts: 49Questions: 0Answers: 0
edited August 2012 in General
Can someone provide me the standard "full numbers" pagination as a plugin, so that I can have a starting point to modify it.
What I need is to set the first button on the left side, then the page numbers buttons centered and last button on the right side.
Some ideas to accomplish this?

Thanks in advance.

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    It is a plug-in in DataTables core: https://github.com/DataTables/DataTables/blob/master/media/src/ext/ext.paging.js#L105 :-)

    Allan
  • valdezrvaldezr Posts: 49Questions: 0Answers: 0
    I put it in a plugin file like this
    $.fn.dataTableExt.oPagination.fulNumbers = {
    fnInit ...
    fnUpdate ...
    }

    but it is indicating at the fnUpdate the following error:
    DataTable is not defined

    var iPageCount = DataTable.ext.oPagination.iFullNumbersShowPages;

    how can I arrange it as a plugin?
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    `DataTable` in that context is simply an alias to $.fn.dataTable ( https://github.com/DataTables/DataTables/blob/master/media/src/DataTables.js#L144 ), so you can just use $.fn.dataTable.ext...

    Allan
This discussion has been closed.