I am new to Syncfusion, so I followed the code on https://github.com/SyncfusionExamples/handling-crud-actions-using-fetch-api-and-react-grid-events/blob/master/after/src/App.tsx.
In NextJS 13 and React, I have the issue that when I change or add a DataGrid row, the event dataSourceChanged isn't triggered. Here's the code:
Any Help is appreciated.
Hi Sascha Affolter,
Greetings from Syncfusion support.
Query: In NextJS 13 and React, I have the issue that when I change or add a DataGrid row, the event dataSourceChanged isn't triggered.
Based on your information, it appears you are encountering an issue where the dataSourceChanged event is not being triggered. It's crucial to understand that this event is triggered when adopting the Custom binding approach. Upon reviewing your provided code, we observed that you are setting the Grid's dataSource as an array of objects (getLeistungen) instead of using result and count. To adopt the Custom binding approach successfully, we recommend setting the Grid's dataSource in the form of result (representing the current view data) and count (representing the total record count).
For more information about the Custom binding approach, please refer to the below documentation.
Custom binding: https://ej2.syncfusion.com/react/documentation/grid/data-binding/data-binding#custom-binding
For more information about the CRUD operations in the Custom binding approach, please refer to the below documentation.
Perform CRUD operations: https://ej2.syncfusion.com/react/documentation/grid/data-binding/data-binding#perform-crud-operations
Regards,
Hemanth Kumar S
I've already tried custom binding through the Fetch-API, but it didn't work either.
I suspect that not triggering this event is related to NextJS 13, where it simply wasn't integrated properly. In the end, "Mr. ChatGPT" made me a reasonable suggestion to work around the whole thing...
Hi Sascha Affolter,
We are pleased to hear that the issue has been resolved on your end. Feel free to return to us if you require further assistance. We will mark this forum as solved.
Regards,
Hemanth Kumar S