contao-components/tablesorter
Contao Tablesorter integrates the jQuery tablesorter plugin into Contao CMS, adding client-side sorting and related table enhancements for back end or front end listings. Useful for making tabular data easier to scan, sort, and navigate.
@vite or @stack directives.wire:sort) while tablesorter handles UI.Query Builder or Eloquent scopes (e.g., orderBy()).Route::post('/sort', [TableController::class, 'sort'])).!important overrides). Use CSS variables or custom classes.<table class="tablesorter" data-tablesorter-theme="bootstrap">
<!-- Columns -->
</table>
@vite(['jquery', 'tablesorter'])).$ conflicts if other libraries use jQuery (e.g., Bootstrap tooltips).npm install jquery tablesorter.public/js or use Vite/Laravel Mix.<script>
$(document).ready(function() {
$('table.tablesorter').tablesorter();
});
</script>
Table::orderBy(request('sort'))).storage/logs/laravel.log).Shift+Click for multi-column sorts).Cache::remember()).| Scenario | Impact | Mitigation |
|---|---|---|
| jQuery not loaded | Tablesorter fails silently | Use @vite with fallback checks. |
| Server-side data mismatch | UI shows stale/sorted data | Implement ETags or timestamps. |
| Large dataset timeouts | Browser hangs | Add client-side loading indicators. |
| CSS conflicts | Broken table styling | Scope tablesorter styles (e.g., :host). |
| Concurrent edits | Race conditions in server-side sort | Use optimistic locking (e.g., lock_for_update). |
README.md or CONTRIBUTING.md.## Tablesorter Setup
1. Add to `resources/js/app.js`:
```js
import 'tablesorter/dist/js/jquery.tablesorter.min.js';
<table class="tablesorter" data-sort-list="[[0,0]]">
<!-- Columns -->
</table>
Log::info('Sort triggered:', ['column' => $column])).dd($query->toSql()) for slow sorts).How can I help you explore Laravel packages today?