I have Data table and large data set and want to set server side script to true, it is working fine on localhost but when I moved the code to server it is showing Data table error. I have inspected the loading script it returns page not found and if Serverside is set to false it is working fine but very slow. Tried too many options from different forum but nothing seems to be working can some one help me out in this.
For reference
This is my script:
function fill_datatable(BusinessUnit = '', CurrOrg1 = '', CurrOrg2 = '', Role = '', Region = '' , Gender = '', CurrOrg3 = '' , CurrOrg4 = '', CurrOrg5 = '', ProfessionalClassification = '',L6 = '',L7 = '', Account = '')
{
var dataTable = $('#members_data').DataTable({
// dom: 'Bfrtip',
// buttons: ['excel'],
processing: true,
serverSide: true,
ajax:{
url: "{{ route('Predictions.index') }}",
data:{BusinessUnit:BusinessUnit,CurrOrg1:CurrOrg1,CurrOrg2:CurrOrg2,Role:Role,Region:Region,Gender:Gender,ProfessionalClassification:ProfessionalClassification,CurrOrg3:CurrOrg3,CurrOrg4:CurrOrg4,CurrOrg5:CurrOrg5,L6:L6,L7:L7,Account:Account}
},
columns: [
{
data: 'EmployeeNumber',
name: 'EmployeeNumber'
..
This my Route:
Route::resource('/Predictions', PredictionsController::class);
have you tried with code like this?
var dataTable = $('#members_data').DataTable({
// dom: 'Bfrtip',
// buttons: ['excel'],
processing: true,
serverSide: true,
url: "{{ route('Predictions.index') }}" or "{{ url('/Predictions') }}"
ajax:{
url: url,
...
},
Sorry if you've tried it.