javascriptjquery-datatables-editor

Datatables Editor pagingType not working


Here is all the code related to the #results table:

jQuery(document).ready(function) {
editor = new jQuery.fn.dataTable.Editor( {
    ajax: "<?php echo $full_dir . '/ajax_call.php'; ?>",
    table: "#results",
    fields: [ {
            label: "Mfg ID",
            name:  "ball_mfg.mfgID"
        }, {
            label: "Mfg name:",
            name:  "ball_mfg.name"
        }, {
            label: "Model #",
            name:  "ball_model.modelID"
        }, {
            label: "Model Name:",
            name:  "ball_model.name"
        }
    ]
} );

jQuery('#results').DataTable( {
    "pagingType": "full_numbers",
    dom: "Bfrtip",
    ajax: {
        url: "<?php echo $full_dir . '/ajax_call.php'; ?>",
        type: 'POST'
    },
    columns: [
        { "render": function ( data, type, full, meta ) {
            return '<input type="radio" name="select_model" class="radio1 my_input" data-modelID="'+full.ball_model.modelID+'">';
        }},  // here's a radio button, modify to use data to populate it,
        { data: "ball_mfg.name" },
        { data: "ball_model.name" }
    ],
    select: false,
    buttons: [
    ]
} );

This only displays the standard Previous, page numbers and Next button. You can view the output at https://www.bowling-tracker.com/bowl/bowling-resources/bowling-ball-information

My preference would actually be to have an input box. You'll note that I have

<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.16/pagination/input.js"></script>

in the header and I've tried to use "pagingType":"input",

as well but it doesn't seem to matter which paging Type that I use, it simply does not change the pagination buttons.

I'm using DataTables Editor to generate this because it needs to be run on the server side (due to returned results) and so I can display only a few tables (which are joined).


Solution

  • Look at the source code that loads. There is no "pagingType". Change it to input so we can see the output when it is written correctly.