Programmatic selection API
Exposes imperative methods to read and change the selection from application code. This supports external controls, deep links, and syncing the selection with other UI. All methods respect the selectability rules and emit change events with an 'api' source.
Planned. This page shows the specification from issue #189. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid of tasks with a toolbar of API buttons and a JSON panel that mirrors getSelectedKeys().
Expected behavior
Each button calls the matching method. The grid and the JSON panel update immediately. Selecting with append off replaces the selection, and with append on adds to it.
Planned API surface
gridApi.selectRows(keys, {append})gridApi.deselectRows(keys)gridApi.toggleRow(key)gridApi.selectAll(scope)gridApi.clearSelection()gridApi.getSelectedKeys()gridApi.getSelectedRows()gridApi.isSelected(key)Acceptance criteria
- selectRows with append=false replaces the selection, and with append=true unions it. (pending)
- getSelectedKeys returns keys in a stable, documented order. (pending)
- getSelectedRows returns row objects, including rows not currently loaded when they have been cached. (pending)
- API calls emit onSelectionChange with source='api'. (pending)
- Unknown keys are ignored and reported in the event payload. (pending)