Can I keep selection when click outside the grid. #73
-
I want to get the selected data when I click on the button[Get selected info] outside the grid.
so, sheetRef.current?.selection will be null. Thank you so much |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Clicking the button blurs the grid before you have time to read the selection. const [lastSelection, setLastSelection] = useState(null)
return <DataSheetGrid onSelectionChange={selection => setLastSelection(selection ?? lastSelection)} /> |
Beta Was this translation helpful? Give feedback.
Clicking the button blurs the grid before you have time to read the selection.
You can keep track of the selection in a state and then read the state when you need it: