Can't select after reload

Can't select after reload

andras2andras2 Posts: 31Questions: 12Answers: 0
edited March 2022 in DataTables

I am using the code, below, but selections are always cancelled after reload:

<script>    
$(document).ready(function() {  
    var table = $('#example').DataTable( {
        select: true,
        stateSave: true,
        ajax: '/api/staff',
        rowId: 'staffId',
        columnDefs: [ {
            orderable: false,
            className: 'select-checkbox',
            targets:   0
        } ],
        select: {
            style:    'os',
            selector: 'td:first-child'
        },
        order: [[ 1, 'asc' ]],
        "ajax": "data.txt"
    } );
    setInterval( function () {
    table.ajax.reload( null, false );
}, 10000 );
} );

</script>

Answers

Sign In or Register to comment.