No data in SearchPane

No data in SearchPane

sunny1407sunny1407 Posts: 2Questions: 1Answers: 0

Hey everyone, am new here and I have this problem plzz anyone help me am so stuck in this..

am building this project in Laravel 7, I used datatables and used ajax to load data into the table, bellow are all the related pages,


 <table class="table table-bordered table-striped table-vcenter js-dataTable-full" id="table_id">
                        <th>Campus Code</th>


function loadtbl() {
                        dom: 'Bfrtip',
                            cascadePanes: true

                        buttons: [
                            'colvis', 'copy', 'csv', 'excel', 'pdf', 'print', 'searchPanes'
                        fixedHeader: true,
                        responsive: true,
                        searchPanes: true,
                        serverSide: true,
                        processing: true,
                        ajax: '{!! route('campuses.index') !!}',
                        columns: [
                            {data: 'ccode', name: 'ccode'},
                            {data: 'name', name: 'name'},
                            {data: 'phone', name: 'phone'},
                            {data: 'address', name: 'address'},
                            {data: 'action', name: 'action', orderable: false, searchable: false},
                                    show: true,
                                targets: [0,1,2,3],


Laravel Controller

public function index(Request $request)
        if ($request->ajax()) {
            $data = Campus::orderBy('id','desc');
            return datatables()::of($data)
                ->addColumn('action', function($row){
                    $action = '<a id="show" data-toggle="modal" data-id='.$row->id.'><button type="button" class="btn btn-rounded btn-outline-success">Show</button></a>
<a id="edit" data-id='.$row->id.'><button type="button" class="btn btn-rounded btn-outline-warning">Edit</button> </a>
<meta name="csrf-token" content="{{ csrf_token() }}">
<a id="delete" data-id='.$row->id.'><button type="button" class="btn btn-rounded btn-outline-danger">Delete</button></a>';

                    return $action;


        return view('campuses.index');


Now everything is working fine, all the pagination and search and everything is fine, The only problem is tht searchpanes dont Work, Plzzzz anyone tell me wht should I do about it, I think I have made some dumb mistake over here.

Here is a video link


  • allanallan Posts: 52,290Questions: 1Answers: 7,966 Site admin

    Since you are using server-side processing, you need to return SearchPanes data in the format described here.


  • sunny1407sunny1407 Posts: 2Questions: 1Answers: 0

    Hey Allan,
    Thanks for your reply, bt am still stuck and cant understand how can I do this in my project (and I did google and tried alot to make it work but its still same)

    Can u plzzz spare some minutes and tell me how shd I make it work in the above given example, or if u can kindly provide me a link to a working example.


  • allanallan Posts: 52,290Questions: 1Answers: 7,966 Site admin

    There is a working example of SearchPanes with server-side processing using the Editor PHP libraries available here.

    See also this blog post on the topic.


Sign In or Register to comment.