- Creating Columns
- Relationships
- Available Methods
- Other Column Types
- Column Selection
- Secondary Header
- Footer
- Reusable Columns
- Anonymous Columns
- Styling
- Standard Column
- Array Columns (beta)
- Avg Columns (beta)
- Boolean Columns
- Button Group Columns
- Color Columns
- Component Columns
- Count Columns (beta)
- Date Columns
- Icon Columns (beta)
- Image Columns
- Link Columns
- Livewire Component (beta)
- Sum Columns (beta)
- View Component Columns
- Wire Link Column (beta)
- Introduction
- Boolean Filters (beta)
- Date Filters
- DateRange Filters
- DateTime Filters
- Multi-Select Dropdown Filters
- Multi-Select Filters
- NumberRange Filters
- Number Filters
- Select Filters
- Text Filters
- Livewire Custom Filter (Beta)
- Refreshing
- Loading Placeholder
- Multiple Tables Same Page
- Actions (beta)
- Adding Custom Markup
- Debugging
- Saving Table State
- Lifecycle Hooks
- Hiding The Table (beta)
- One Of Many Example
- Tools
Getting Started
Usage
DataTable
Columns
Column Types
Rows
Sorting
Pagination
Search
Bulk Actions
Filters
Filter Types
Reordering
Secondary Header
Footer
Examples
Misc.
Sponsored
Advanced Usage
Examples
🎉 Enjoying this package? Consider sponsoring me on GitHub or buying me a beer.
This is the documentation for v3. You can switch versions in the menu on the left/at the top. Check your current version with the following command:
composer show rappasoft/laravel-livewire-tables
Available Methods
These are the available sorting configuration methods on the component.
Sorting as a whole is enabled by default, but if you ever needed to toggle it you can use the following methods:
setSortingStatus
Enable/disable sorting for the whole component.
1public function configure(): void2{3 $this->setSortingStatus(true);4 $this->setSortingStatus(false);5}
setSortingEnabled
Enable sorting for the whole component.
1public function configure(): void2{3 // Shorthand for $this->setSortingStatus(true)4 $this->setSortingEnabled();5}
setSortingDisabled
Disable sorting for the whole component.
1public function configure(): void2{3 // Shorthand for $this->setSortingStatus(false)4 $this->setSortingDisabled();5}
Single sorting is enabled by default, but if you ever needed to toggle it you can use the follow methods:
setSingleSortingStatus
Enable/disable single sorting for the whole component.
1public function configure(): void2{3 $this->setSingleSortingStatus(true);4 $this->setSingleSortingStatus(false);5}
setSingleSortingEnabled
Enable single sorting for the whole component.
1public function configure(): void2{3 // Shorthand for $this->setSingleSortingStatus(true)4 $this->setSingleSortingEnabled();5}
setSingleSortingDisabled
Disable single sorting for the whole component.
1public function configure(): void2{3 // Shorthand for $this->setSingleSortingStatus(false)4 $this->setSingleSortingDisabled();5}
There is no default sort by default, but if you wanted to add one:
setDefaultSort
Set the default sorting column and direction.
1public function configure(): void2{3 $this->setDefaultSort('name', 'desc');4}
If you had the need to programmatically remove the default sort:
removeDefaultSort
Remove the default sort.
1public function configure(): void2{3 $this->removeDefaultSort();4}
Sorting pills are enabled by default, but if you ever needed to toggle it you can use the following methods:
setSortingPillsStatus
Enable/disable sorting pills for the whole component.
1public function configure(): void2{3 $this->setSortingPillsStatus(true);4 $this->setSortingPillsStatus(false);5}
setSortingPillsEnabled
Enable sorting pills for the whole component.
1public function configure(): void2{3 // Shorthand for $this->setSortingPillsStatus(true)4 $this->setSortingPillsEnabled();5}
setSortingPillsDisabled
Disable sorting pills for the whole component.
1public function configure(): void2{3 // Shorthand for $this->setSortingPillsStatus(false)4 $this->setSortingPillsDisabled();5}
setDefaultSortingLabels
If you would like to set the default sorting labels for the sorting pills you may override them:
By default, they are A-Z for ascending and Z-A for descending.
1public function configure(): void2{3 $this->setDefaultSortingLabels('Asc', 'Desc');4}