7 months ago

Datatable Checkbox Invalid JSON error

Posted 7 months ago by Vishaal


I have create datatable with checkboxes now after much try i have write the code in jquery to massremove checkbox. But when i'm executing this jquery its give me error: DataTables warning: table id=datatabel - Invalid JSON response. For more information about this error, please see

$(document).on('click', '#deletejobs', function(){
            var id = [];
            if(id.length > 0)
                    url:"{{ route('aanvragertaken.massremove')}}",
                    method: "get",
                alert("Please select atleast one checkbox");

jquery for table (this works good):

$(document).ready(function() {
                $('#datatabel').DataTable( {
                    responsive: true,
                    "language": {
                        "lengthMenu": "Records _MENU_ per pagina",
                        "zeroRecords": "Geen resultaat gevonden",
                        "info": "Pagina _PAGE_ van _PAGES_",
                        "infoEmpty": "Geen resultaat gevonden",
                        "infoFiltered": "(filtered from _MAX_ total records)"
                } );
            } );

<td><input type="checkbox" class="checkbox" value="{{$takenlijst->id}}" name="checkbox[]" /></td>

What i'm doing wrong that i'm getting that invalid json?

Please sign in or create an account to participate in this conversation.