How can use "select-checkbox" class and select one row only

How can use "select-checkbox" class and select one row only

sylverelfsylverelf Posts: 1Questions: 1Answers: 0

Here My datatable propreties,

var MyTable = $("#MyTable ").DataTable({
        dom: '<B><fr><t><lp>',

        buttons: [
            'selectAll',
            'selectNone',
        ],

        ajax: {
            url: baseUrl + 'api/MouvementsAPI/GetMouvementsbyStatut/2',
            dataSrc: ''
        },

        columns: [
              {
                  orderable: false,
                  className: 'select-checkbox',
                  "data": null,
                  "defaultContent": ''
              },
            {
                "className": 'details-controlEquip',
                "orderable": false,
                "data": null,
                "defaultContent": ''
            },

            { data: 'no_mouvement' },
            { data: 'type_mouvement' },
            { data: 'source' },
             {
                 "targets": -1,
                 "data": null,
                 "defaultContent": '<span class="Gen"><i class="far fa-file-pdf"></i></span>&nbsp;&nbsp;'

             }
        ],

        select: {
            style: 'os',
            selector: 'td:first-child'
        },

        info: false,
        responsive: true,
        lengthMenu: [[100, 50, 25, 10, -1], [100, 50, 25, 10, "All"]],
        order: [[1, 'asc']],
        visible: true, api: true 
    })

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.