Closed timk closed 1 month ago
Sorry for the late response.
Actually you can access an array of selected rows as a writable store, by using handler.getSelected()
So the best way would be:
const selected = handler.getSelected()
function handleClearSelection() {
$selected = []
}
If your function runs outside of a Svelte component:
function handleClearSelection() {
handler.getSelected().set([])
}
Is there a way to clear/de-select all selected rows?
The way I've worked around it is once updated all selected rows as a group, I can run
selectAll()
twice, as a way to clear the selection. This poses UI updates and unnecessary processing. The other way around it is to subscribe to changes then iterate through a shadow array to callselect()
on each row, this also seems not optimal.