DataTables 2.0

DataTables 2.0

Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

I updated my project to Datatables 2.0 and encountered some issues

The client does not send the search columns in the request, as in https://datatables.net/manual/server-side. Are there any changes here that I missed?

I'm trying to replace the dom with the new layout option.
How do I add the B (buttons) in this layout option?

How can I put the buttons in the middle of the TopN field?
The page length should be included in topStart and the search area in topEnd. In the middle the buttons. I tried with the custom display element but the result is not what I imagined

Andreas

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    I need a link to a test case showing the issue please? If I use this example and in the console type:

    $('#example').DataTable().column(0).search('Airi').draw();
    

    I can see that it does sent the required search parameter and will also filter the table.

    Regarding aligning the middle buttons, what styling are you using? Again a test case would be useful.

    Thanks,
    Allan

  • Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

    I send you a testlink for my problem.

    Andreas

  • Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

    I think i have found the problem with the missing search parameter.

    It is the import 'datatables.net-buttons-bs5'; If i add it, i got an error like this:

    buttons.bootstrap5.mjs:13
    Uncaught TypeError: Cannot read properties of undefined (reading 'defaults')
    at buttons.bootstrap5.mjs:13:34
    (anonymous) @ buttons.bootstrap5.mjs:13

    Andreas

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Answer ✓

    See my newest comment in this thread to resolve that particular issue with the buttons defaults.

    Allan

  • Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

    Dis not work, Now i get this:

    dataTables.bootstrap5.mjs:43
    Uncaught TypeError: Cannot set properties of undefined (setting 'bootstrap')
    at dataTables.bootstrap5.mjs:43:37
    (anonymous) @ dataTables.bootstrap5.mjs:43
    Show less

    Andreas

  • Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

    I made a mistake transferring the extension.

    "overrides": {
        "datatables.net-bs5": {
          "datatables.net": "2.0.0"
        }
      }
    

    This is how it works now

    Andreas

Sign In or Register to comment.