Custom pagination button types

Custom pagination button types

bbabicbbabic Posts: 3Questions: 1Answers: 0

Link to test case:
https://datatables.net/plug-ins/pagination/bootstrap_input

Debugger code (debug.datatables.net):
I've tried to use debugger, but I get following error when I click "Check for common issues":
DT_Debug.js?rand=1709303550192:867 Uncaught TypeError: Cannot read properties of null (reading 'indexOf')
at _Api.<anonymous> (DT_Debug.js?rand=1709303550192:867:17)
at _Api.iterator (datatables.js:18262:15)
at Object.fn (DT_Debug.js?rand=1709303550192:864:42)
at Object.default_1 [as common] (DT_Debug.js?rand=1709303550192:413:43)
at HTMLDivElement.<anonymous> (DT_Debug.js?rand=1709303550192:97:25)
at HTMLDivElement.dispatch (jquery-3.6.4.min.js:2:43184)
at y.handle (jquery-3.6.4.min.js:2:41168)
(anonymous) @ DT_Debug.js?rand=1709303550192:867
iterator @ datatables.js:18262
(anonymous) @ DT_Debug.js?rand=1709303550192:864
default_1 @ DT_Debug.js?rand=1709303550192:413
(anonymous) @ DT_Debug.js?rand=1709303550192:97
dispatch @ jquery-3.6.4.min.js:2
y.handle @ jquery-3.6.4.min.js:2

Clicking on "Upload configuration data" gives following error:
DT_Debug.js?rand=1709303550192:571 Uncaught TypeError: table.oInstance.fnGetData is not a function
at gatherData (DT_Debug.js?rand=1709303550192:571:39)
at DT_Debug.js?rand=1709303550192:497:13

Error messages shown:
DataTables warning: table id=table-users - Unknown paging action: input. For more information about this error, please see https://datatables.net/tn/5

Description of problem:
I'm trying to add custom button type to pagination, but whatever I do I always get above error after clicking on new button.
I wanted to use example pagination plugin, but it obviously does not work. As a matter of fact, none of the example plugins work!

I'm using DataTables version 2.0.1 (up to date, according to debugger)

Does anybody have any working custom paging solution available?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,986Questions: 1Answers: 10,365 Site admin

    That plug-in needs to be rewritten for DataTables 2. It will likely be a few weeks before I can get to that. Apologies.

    Allan

  • bbabicbbabic Posts: 3Questions: 1Answers: 0

    Thanks for the reply.
    Could you maybe give me some pointers on how to fix it so I can do it myself?

    Looking at the source code, I pretty much understand what functions I need to "extend" or change, but I would prefer to go proper official way instead of making quick hacks to get something to work as expected.

  • bbabicbbabic Posts: 3Questions: 1Answers: 0

    Even though you did answer my question, I just clicked "no" in hope that you will provide some feedback on my previous request for help to implement this change myself.

  • allanallan Posts: 62,986Questions: 1Answers: 10,365 Site admin
    Answer ✓

    Throw out the existing plug-in code as step 1 :).

    What to do is implement this as a feature plug-in. Then it can be placed around the table using the layout option. It would have buttons for previous / next pages and an input element. Use the page.info() for most of the interaction, although page() will also be needed to set the page.

    Allan

Sign In or Register to comment.