dataSourceChanged event not triggered

320 Views Asked by At

I pulled the example repo to codesandbox.io and trying to trigger dataSourceChanged event pushing ui buttons like "Update", "Add" and logging the state variable to the console (lines 41-42 of App.tsx):

  function dataSourceChanged(state: any) {
    console.log(state); //should log to the console

any idea why it's not firing when im pushing new rows to the grid or updating existing ones? Thanx

1

There are 1 best solutions below

0
On

Syncfusion support answered me directly on this one. I had to change getOrders function

export function getOrders() { 
  return fetch(baseUrl + "/orders") 
    .then((res) => res.json()) 
    .then((data) => { 
      return { 
        count: data.length, 
        result: data 
      }; 
    }); 
}