Posted 29 June 2020, 9:02 am EST
Hi,
i have child component with a flexgid on it and I want the parent component to know what row was selected. The problem is that when i pass property assignment function and call it from the child - it forces the grid to re-render, losing the selected row.
parent.tsx:
const [selectedRowCell, setSelectedRowCell] = useState(“”);
function setSelectedRowCellFromChild(value: string): void {
console.log(value);
setSelectedRowCell(value);
}
ChildComponent.tsx:
<FlexGrid itemsSource={data}
selectionChanged={(s: wjGrid.FlexGrid) =>
props.setSelectedPortfolioCode(s.selectedItems[0].value)
}