When To Use What
Decision guide for selecting the right UX DataTables setup
Use this guide as a fast decision tree.
Scenario Matrix
| Scenario | Recommended setup | Why |
|---|---|---|
| Small dataset (< 5k rows) | DataTable + data() or simple ajax() | Minimal backend logic |
| Large dataset | serverSide(true) + backend filtering | Avoid loading all rows in browser |
| Reusable table across screens | AbstractDataTable | Encapsulates behavior and data access |
| Hydra API backend | ajax() + apiPlatform(true) | Converts DataTables params to API Platform |
| Export actions | ButtonsExtension | CSV/Excel/PDF/Print support |
| Row selection workflows | SelectExtension | Built-in selection modes |
| Live refresh of a server-side table | poll() for outside or continuous changes, Mercure when your app knows what changed | Polling needs no hub; Mercure pushes only on change |
| Totals in the footer | summarize() | Covers every matching row, not only the page |
| Users build their own search | SearchBuilder | Grouped conditions without custom filter code |
| Custom empty table or clickable rows | Row presentation | Empty state, row classes, and row links |
| Horizontal-heavy table | ResponsiveExtension or FixedColumnsExtension | Better readability on small viewports |
Recommended Defaults
- Start with Usage.
- Move to AbstractDataTable once table logic grows.
- Enable server-side mode early for high-cardinality entities.
- Add extensions incrementally and test interactions.