Skip to content

Commit 17f796c

Browse files
committed
Add docs for setting export type or filename.
1 parent 6e508f0 commit 17f796c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,27 @@ class PermissionsDataTable extends DataTable
6666

6767
3. Run your queue worker via `php artisan queue:work`.
6868

69+
## Export Filename
70+
71+
You can set the export filename by setting the property.
72+
73+
```phpt
74+
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" filename="my-table.xlsx" />
75+
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" filename="my-table.csv" />
76+
77+
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" :filename="$filename" />
78+
```
79+
80+
## Export Type
81+
82+
You can set the export type by setting the property to `csv` or `xlsx`. Default value is `csv`.
83+
84+
```phpt
85+
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" type="xlsx" />
86+
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" type="csv" />
87+
```
88+
89+
6990
## Contributing
7091

7192
Please see [CONTRIBUTING](https://github.com/yajra/laravel-datatables-export/blob/master/.github/CONTRIBUTING.md) for details.

0 commit comments

Comments
 (0)