laravel-datatables: DataTables warning: table id=mytable- Ajax error.

can I ask some help why it is not working.is there some files that are missing ?

Thank you in advance.

  $(function() {
            $('#mytable').DataTable({
                processing: true,
                serverSide: true,
                ajax: '/admin/enrollment/all_list'


            });
        });

//routes.php

Route::get('admin/enrollment/all_list', 'Admin\EnrollmentController@getEnroll');


//EnrollmentController

  public function getEnroll(){

        $users = User::select(['studentid','fname','lname']);
        return Datatables::of($users)->make();

    }


About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@faazlila maybe try clearing the cache and config.

php artisan cache:clear
php artisan config:clear

/public/css/datatables.bootstrap.css and /public/images/loading_bar.gif or try adding this on your css.

.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px;
    height: 80px;
    margin-left: -125px;
    margin-top: -15px;
    padding: 15px 0 30px 0;
    border: 1px solid #ddd;
    text-align: center;
    color: #444;
    font-size: 14px;
    background: url("../images/loading_bar.gif") no-repeat center 38px #fff;
    box-shadow: 2px 2px 5px #444;
    -moz-box-shadow: 2px 2px 5px #444;
    -webkit-box-shadow: 2px 2px 5px #444;
    z-index: 9999;
}