ssquare's avatar

Jquery datatable throws error as soon as I implement laravel pagination links

@foreach($users as $kv => $vv)
                                    <tr>
                                        <td>{{ $vv -> name}}</td>
                                        <td>{{ $vv-> address}}</td>
                                        <td>{{ city }}</td>
                                        <td> Actions </td>
                                    </tr>
                                    @endforeach
                                    <tr>
                                        <td colspan="100%"> 
                                            {{ $users->links() }}
                                        </td>
                                    </tr>

Error: Cannot set property '_DT_CellIndex' of undefined

After this error, it also does not show datatable's search, sorting and filtering. But as soon as I remove {{$users -> links }} everything works fine.

What I am trying?

I am trying to implement laravel pagination with jquery datatables. As, even serverside jquery datatables took quite long time to process around 30M data. Is there any way to use laravel pagination but jquery datatable's sort, search, and filter?

Any suggestion will be appreciated.

0 likes
2 replies
Inquisitive's avatar

Try script:


$('#datatableID').DataTable({
                "paging":   false,
            });

And remove that customer links from and place it below the table. As

........
........
........
</table>
{{ $users->links() }}

Please or to participate in this conversation.