DataTables wont work on Laravel 10

DataTables wont work on Laravel 10

rachashrachash Posts: 1Questions: 1Answers: 0

i use datatables to bring up data from the database, but when i try to use it, the plugin doesn't work. but if I match using pagination(2) according to the number of tables I have, the plugin works. how to fix it?

Controller

public function index()
{
$kberitas = Kberita::all();
return view('Tools.Kberita.kberita',compact('kberitas'))->with('i');
}

View

<tbody>
<tr>
@foreach ($kberitas as $kberita )
<td>{{ ++$i }}</td>
<td>{{ $kberita->brt_kategori }}</td>
<td>Action</td>
@endforeach
</tr>
</tbody>

Answers

  • allanallan Posts: 61,584Questions: 1Answers: 10,084 Site admin

    You are going to have to give me a bit more information than that! Can you show me the generated HTML for example? Or even better, a link to a test case showing the issue, as requested in the template text you deleted and the forum rules.

    My guess is that each row is surrounded by its own tbody. But I'd need more information to say for sure.

    Allan

Sign In or Register to comment.