vendredi 17 janvier 2020

Laravel Data Table Error - Cannot reinitialise DataTable

I have Used Laravel Data table to show some data and I tried to use a custom search with additional parameters. but when I search it says cannot reinitialize data table. please help me to solve it

<table class="table table-bordered first" id="laravel_datatable">
<thead class="thead-custom">
     <tr>
       <th>ID</th>
       <th>Title</th>
       <th>Body</th>
       <th>Created at</th>
      </tr>
</thead>
</table>

function search(){
        $('#laravel_datatable').DataTable({
         processing: true,
         serverSide: true,
         ajax: {
          url: "",
          type: 'GET',
          data: function (d) {
          }
         },

        columns: [
            {data: 'rep_price_id', name: 'rep_price_id'},
            {data: 'rep_code', name: 'rep_code'},
            {data: 'pro_no', name: 'pro_no'},
            {data: 'created_at', name: 'created_at', orderable: false, searchable: false},
        ]
  });
}
</script>


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2ucG1H2
via IFTTT

Aucun commentaire:

Enregistrer un commentaire