Hi,
I have a datagrid using datamanager to render order data.
const dataManager = new DataManager({
adaptor: new UrlAdaptor(),
updateUrl:
process.env.REACT_APP_API_SERVER +
`/api/order/daily?store_id=${userInfo.storeId}&date=${moment(
date
).format('YYYY-MM-DD')}`,
url:
process.env.REACT_APP_API_SERVER +
`/api/order/daily?store_id=${userInfo.storeId}&date=${moment(
date
).format('YYYY-MM-DD')}`,
});
When user change the date for the order, the datagrid shows the order data for that date.
However, when user change the date, the grid ref is changed to null.
<GridComponent
id='bill'
dataSource={dataManager}
editSettings={editSettings}
ref={(g) => {
console.log(g);
setGridInstance(g);
}}
>
It seems that if the datamanager changes the data, ref stops working. How could I access the grid instance?
Thanks,