1 year ago

DataTables Sorting & Searching not working

Posted 1 year ago by Ap3twe

I am using data tables in Laravel. The values are inserted with dynamic blade syntax. When I click ordering, it does not sort. Searching returns no match even though I provide the correct values. How do I solve this? NB: Looking in the chrome console, I see the table body changes state.

       //Table cases javascritpt
              $(document).ready( function () {

               } );
               $.extend( $.fn.dataTable.defaults, {

                 ordering: true,
                 select: true,
                 "order": [[ 0, 'desc' ], [ 1, 'desc' ], [2, 'desc'], [3, 'desc']]
              } );
 <table class="table table-striped table-bordered" id="table_id">
                            <th>Case Number</th>
                            <th>Case Form</th>
                            <th>Patient Name</th>
                            <th>Date Created</th>
            @foreach ($project as $project)
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->case_number}}</a></td>
                 @if ($project->services0)
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services0}}</a></td> 
                 @elseif ($project->services1)
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services1}}</a></td> 
                 @elseif ($project->services2)
                 {{-- <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services2 . '  '  . $project->mockup0}}</a></td>  --}}
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services2 . '  '  . $project->mockup0 . ' ' . $project->mockup1}}</a></td> 





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