From 4752cea160648b584d2b20be064187ee055b89c3 Mon Sep 17 00:00:00 2001 From: happymacarts Date: Tue, 30 Aug 2022 13:27:33 -0700 Subject: [PATCH] Update table-models.md update docs for table buttons array options --- docs/table-models.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/table-models.md b/docs/table-models.md index 3cce42f..6392b15 100644 --- a/docs/table-models.md +++ b/docs/table-models.md @@ -263,4 +263,37 @@ $(document).on('dtrow:mouseenter', (event, row, data, table) => { $(document).on('dtrow:mouseleave', (event, row, data, table) => { //do something }); + +### Buttons +You can specify Table based buttons for available options view Datatables https://datatables.net/reference/button/ +Note: you must use php array not JSON for example ``` + /** + * define the Table buttons array + * + * @return array + */ + public function buttons(): array + { + return [ + [ + 'extend' => 'print', + 'text' => 'Print', + 'exportOptions' => [ + 'columns' => [0, ':visible'], + ], + ], + [ + 'extend' => 'csv', + 'text' => 'Excel', + 'exportOptions' => [ + 'columns' => [0, ':visible'], + ], + ], + 'copy', + [ + 'extend' => 'colvis', + 'className' => 'btn btn-info' + ] + ]; + }