Laravel-datatables: lengthMenu is not showing up

Created on 18 Dec 2017  ·  3Comments  ·  Source: yajra/laravel-datatables

Summary of problem or feature request

I am using data tables as service, and lengthMenu is not showing up

missing

return $this->builder()
            ->columns($this->getColumns())
            ->minifiedAjax()
            // ->addAction(['width' => '80px'])
            ->parameters([
                'lengthMenu' => [ 10, 25, 50, 75, 100 ],
                'dom'     => 'Bfrtip',
                'order'   => [[0, 'desc']],
                'buttons' => [
                    'create',
                    'export',
                    'print',
                    'reset',
                    'reload',
                ],
            ]);

System details

  • UBUNTU 16.04
  • PHP 7.0
  • Laravel Version 5.5.23
  • Laravel-Datatables Version 8

THANKS !!

css javascript question

Most helpful comment

thanks @yajra
i made the below changes and it worked 👍

return $this->builder()
            ->columns($this->getColumns())
            ->minifiedAjax()
            // ->addAction(['width' => '80px'])
            ->parameters([
                'lengthMenu' => [
                        [ 10, 25, 50, -1 ],
                        [ '10 rows', '25 rows', '50 rows', 'Show all' ]
                ],                      
                'dom'     => 'Bfrtip',
                'order'   => [[0, 'desc']],
                'buttons' => [
                    'pageLength',
                    'create',
                    'export',
                    'print',
                    'reset',
                    'reload',
                ],
            ]);

All 3 comments

Are you extending the dataTables default? Better check that you are not disabling the pageLength and other related options. Also, it seems like you are using a custom styles, thus double check that you have a visible page info layer?

@yajra thanks for replying , ok i will check and inform you shortly.

thanks @yajra
i made the below changes and it worked 👍

return $this->builder()
            ->columns($this->getColumns())
            ->minifiedAjax()
            // ->addAction(['width' => '80px'])
            ->parameters([
                'lengthMenu' => [
                        [ 10, 25, 50, -1 ],
                        [ '10 rows', '25 rows', '50 rows', 'Show all' ]
                ],                      
                'dom'     => 'Bfrtip',
                'order'   => [[0, 'desc']],
                'buttons' => [
                    'pageLength',
                    'create',
                    'export',
                    'print',
                    'reset',
                    'reload',
                ],
            ]);
Was this page helpful?
0 / 5 - 0 ratings