Table - Selection
The Table component supports single and multiple selection.
Multiple Selection
Configure selection-config type as checkbox to enable multiple selection.
Single Selection
Configure selection-config type as radio to enable single selection.
Disabled Selection
Use selection-config.checkable function to control whether a row can be selected.
Cross-Page Selection
Set selection-config.reserve to true to preserve selection state when switching pages.
Practical: Cross-Page Selection & Echo
Combine with pagination component to request online API JSONPlaceholder, demonstrating cross-page selection and selected data echo in real scenarios.
Practical: Pagination Init Echo
Simulate editing scenario - get previously saved selection data from backend when page loads, automatically echo selection state via selectedRowKeys. When switching to the corresponding page, rows belonging to that page will be automatically checked; also supports continue checking/unchecking operations.
Core Principle: Write backend returned selected data to
Map, extractkeysand pass toselectedRowKeys, the table will automatically mark matching rows as selected.