Hello,
I am trying to get data from a table, but when I call getData() on selected, I get the nested array with [null]s.
Is there a way to get only the used range so only the non null values?
Example:
Selecting the whole column and only wanting the used (non null) values.
I am using React
Current output
Here is my function to getSelection()
export const getSelection = () => {
const hot = hotRef.current.hotInstance;
const selected = hot?.getSelected() || [];
let data: any[] = [];
if (selected.length === 1) {
data = hot?.getData(...selected[0]!) || [];
}
return data;
};
I know I could build a custom function to find only the non null values but is there a way that is already implemented? I have looked through the documentation and I could not find anything. Maybe my approach is wrong in the first place?