addColumn('action', 'worklist.action') ->setRowId('id'); } /** * Get the query source of dataTable. */ public function query(Worklist $model): QueryBuilder { return $model->newQuery(); } /** * Optional method if you want to use the html builder. */ public function html(): HtmlBuilder { return $this->builder() ->setTableId('worklist-table') ->columns($this->getColumns()) ->minifiedAjax() // ->dom('Bfrtip') ->orderBy(1) ->selectStyleSingle() ->buttons([ Button::make('excel'), Button::make('csv'), Button::make('pdf'), Button::make('print'), Button::make('reset'), Button::make('reload'), ]); } /** * Get the dataTable columns definition. */ public function getColumns(): array { return [ Column::computed('action') ->exportable(false) ->printable(false) ->width(60) ->addClass('text-center'), Column::make('id'), Column::make('add your columns'), Column::make('created_at'), Column::make('updated_at'), ]; } /** * Get the filename for export. */ protected function filename(): string { return 'Worklist_'.date('YmdHis'); } }