jxlwqq / data-table
dataTable for laravel-admin
Installs: 41 610
Dependents: 0
Suggesters: 0
Security: 0
Stars: 32
Watchers: 2
Forks: 15
Open Issues: 3
Requires
- php: >=7.0.0
- encore/laravel-admin: ~1.6
Requires (Dev)
- phpunit/phpunit: ~6.0
This package is not auto-updated.
Last update: 2024-11-08 16:48:53 UTC
README
Add advanced interaction controls to your HTML tables the free & easy way.
ScreenShot
Install
composer require jxlwqq/data-table php artisan vendor:publish --tag=laravel-admin-data-table
Update
composer require jxlwqq/data-table php artisan vendor:publish --tag=laravel-admin-data-table --force
Configurations
Add extensions
option in your config/admin.php
configuration file:
'extensions' => [ 'data-table' => [ // If the value is set to false, this extension will be disabled 'enable' => true, // global options 'options' => [ 'paging' => false, 'lengthChange' => false, 'searching' => false, 'ordering' => false, 'info' => false, 'language' => 'English', // or Chinese ] ] ]
More languages can be found in DataTable i18n.
Use
use Jxlwqq\DataTable\DataTable; // table $headers = ['Id', 'Email', 'Name', 'Company']; $rows = [ [1, 'labore21@yahoo.com', 'Ms. Clotilde Gibson', 'Goodwin-Watsica'], [2, 'omnis.in@hotmail.com', 'Allie Kuhic', 'Murphy, Koepp and Morar'], [3, 'quia65@hotmail.com', 'Prof. Drew Heller', 'Kihn LLC'], [4, 'xet@yahoo.com', 'William Koss', 'Becker-Raynor'], [5, 'ipsa.aut@gmail.com', 'Ms. Antonietta Kozey Jr.', 'Goooogle'], ]; $style = ['table-bordered','table-hover', 'table-striped']; $options = [ 'paging' => true, 'lengthChange' => false, 'searching' => false, 'ordering' => true, 'info' => true, 'autoWidth' => false, ]; $dataTable = new DataTable($headers, $rows, $style, $options); echo $dataTable->render();
more options can be found in DataTable Documentation.
More resources
License
Licensed under The MIT License (MIT).