BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Active Cell is not being captured, if I click on some other cell and save the sheet, then only it's getting captured.
Here is the source code ->
Here is Screenshot, you can see, rows[0] has value but rows[1] doesn't.
This is the same issue I am facing but solution provided here is not working -> https://www.syncfusion.com/forums/156783/how-to-get-current-cell-text-from-saveasjson-method
When I click on other cell, you can see 'World' is captured.
Even normal save method is not capturing active cell data.
On clicking other cell.
Hi Salokya,
Based on our behavior, the edited cell value gets updated in the cell model after clicking any cell or pressing the Enter key. And this is our behavior, which is not an issue on our end. If you need the edited cell value after loading the saved JSON, you need to call the endEdit method before saving the JSON data. For your reference, we have modified the sample based on our suggestion by using the endEdit method. Please find the link below.
Sample Link: https://stackblitz.com/edit/react-gmavkj-jcugsp?file=index.js,package.json
UG Link: https://ej2.syncfusion.com/react/documentation/spreadsheet/editing#save-cell
One last thing, can I use Datamanager for binding remote data and performing CRUD operations in form of JSON?
Hi Salokya,
Yes, you can update the data to spreadsheet using the data manager. For more details regarding remote data binding, please refer to the below links.
Demo Link: https://ej2.syncfusion.com/react/demos/#/bootstrap5/spreadsheet/remote-data-binding
UG Link: https://ej2.syncfusion.com/react/documentation/spreadsheet/data-binding#remote-data
For CRUD operation, dataSourceChanged event handler will be triggered when editing, inserting and deleting a row is made on the datasource range. It is triggered with parameter named action which indicates edit, add and delete for the respective action. By using this event you can do your customization in your end.
public dataSourceChanged (args): void { //args.data returns the modified data in spreadsheet switch (args.action) { case 'edit': console.log('Edited Data: ' + JSON.stringify(args.data)); //Do your customization for edit action break; case 'add': console.log('Added Data: ' + JSON.stringify(args.data)); // Do your customization for insert action break; case 'delete': console.log('Deleted Data: ' + JSON.stringify(args.data)); // Do your customization edit action break; } } |