Skip to content

Commit d82942e

Browse files
author
ohayn
committed
Support for multiple tables
1 parent be8982a commit d82942e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

resources/views/index.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<table {!! $attributes !!} style="width:100%">
1+
@php($id = 'datatable-' . uniqid())
2+
<table id="{{ $id }}" {!! $attributes !!} style="width:100%">
23
<thead>
34
<tr>
45
@foreach($headers as $header)
@@ -19,7 +20,7 @@
1920

2021
<script>
2122
$(function () {
22-
$('.dataTable').DataTable(
23+
$('#{{ $id }}').DataTable(
2324
{!! $options !!}
2425
)
2526
})

0 commit comments

Comments
 (0)