diff --git a/README.md b/README.md index 1c761af..56ec04a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Ginkelsoft DataTables +# Ginkelsoft DataTables version 0.0.9 Ginkelsoft DataTables is a flexible and easy-to-use package for managing tabular data in Laravel projects. This package **requires Livewire** for dynamic, AJAX-driven experiences. You can easily add filtering, searching, sorting, and bulk actions with minimal setup. @@ -10,10 +10,11 @@ Ginkelsoft DataTables is a flexible and easy-to-use package for managing tabular 2. [Installation](#installation) 3. [Usage With Livewire](#usage-with-livewire) 4. [Filters](#filters) -5. [Actions & Bulk Actions](#actions--bulk-actions) -6. [Additional Features](#additional-features) -7. [Contributing](#contributing) -8. [License](#license) +5. [Sorting](#sorting) +6. [Actions & Bulk Actions](#actions--bulk-actions) +7. [Additional Features](#additional-features) +8. [Contributing](#contributing) +9. [License](#license) --- @@ -48,30 +49,33 @@ This package **requires Livewire** and cannot be used without it. To integrate D ```blade ``` You can now: -- **Search** by typing in the search field. +- **Search** - **Sort** by clicking column headers. - **Paginate** without page reload. - **Select rows** individually or choose to select all. +- Filters --- @@ -81,15 +85,31 @@ You can define various filters for refining results dynamically. ```blade :filters="[ - ['column' => 'name', 'type' => 'text'], - ['column' => 'role', 'type' => 'select', 'options' => ['admin' => 'Admin', 'user' => 'User']], - ['column' => 'created_at', 'type' => 'date'], - ['column' => 'active', 'type' => 'boolean'] + ['column' => 'name', 'type' => 'input', 'label' => 'Naam'], + ['column' => 'email', 'type' => 'input', 'label' => 'Email'], + ['column' => 'created_at', 'type' => 'date', 'label' => 'Aangemaakt op'], + ['column' => 'email_verified_at', 'type' => 'checkbox', 'options' => ['1' => 'Verified', 'null' => 'Not Verified'], 'label' => 'Email bevestigd'], + ['column' => 'email_verified_at', 'type' => 'select', 'options' => ['1' => 'Verified', 'null' => 'Not Verified'], 'label' => 'Email bevestigd'] ]" ``` --- +## Sorting + +Sorting is enabled by default. Clickable column headers allow users to sort the data in ascending or descending order. + +By default, sorting is applied to the first column in the `:columns` array. If needed, sorting can be applied programmatically by setting: + +```php +'sortColumn' => 'created_at', +'sortDirection' => 'desc', +``` + +Sorting is supported for all columns in the dataset, including text, dates, and booleans. + +--- + ## Actions & Bulk Actions ### Row Actions @@ -139,3 +159,4 @@ We welcome improvements to code quality, new features, or better documentation. ## License Ginkelsoft DataTables is open-sourced software licensed under the [MIT license](LICENSE). +