Spreadsheet- Am not able to edit and save the first sheet when add multiple sheets.

Hi Team,

I am facing issues with spreadsheet.

i am trying to add multiple sheets and select first to change the data, but it showing spinner loading and some times whatever the data inside that is not getting saved, also showing the  error in console like (address.js:10 Uncaught (in promise) TypeError: Cannot read property 'indexOf' of undefined)

Export code:

var id = 'spreadsheet-' + this.props.id
var spreadsheetEditor = document.getElementById(id).ej2_instances[0]

after export, we are saving JSON in DB

 

<SpreadsheetComponent
id={'spreadsheet-' + this.props.id}
allowEditing={componentType !== 'viewReport'}
showFormulaBar={componentType !== 'viewReport'}
showRibbon={componentType !== 'viewReport'}
>
<SheetsDirective>
<SheetDirective>
<RangesDirective>
<RangeDirective />
</RangesDirective>
</SheetDirective>
</SheetsDirective>
</SpreadsheetComponent>






5 Replies

JS Janakiraman Sakthivel Syncfusion Team July 8, 2021 04:07 AM UTC

Hi Arul Lakshmanan, 

Thank you for contacting Syncfusion support. 

We have checked your reported issue and we are not able to replicate this in our end. For your convenience, we have prepared the sample for this. Please find the link below.
 
 
So please share us the following details to proceed further. 
 
1. If you have facing this issue with editing and saving the spreadsheet data as JSON, If possible please replicate your issue in the above sample and send back to us. 
 
2. Please share the codes, if you have done any customization in sample level. 
 
Could you please get back to us with the above requested information, based on that we will check and provide you a better solution quickly. 
 
Regards,

Janakiraman S.
 



AL Arul Lakshmanan replied to Janakiraman Sakthivel July 8, 2021 09:58 AM UTC

Hi, Thanks for the update.

We have a JSON with multiple sheets, but the sheet1 JSON not getting displayed when we are in create or edit mode , below i attached the json file can you please check it.


save code :

var id = 'spreadsheet-' + this.props.id
var spreadsheetEditor = document.getElementById(id).ej2_instances[0]

spreadsheetEditor.saveAsJson().then(Json => {
this.response = Json
console.log('get data from json', this.response)
this.props.onHandleUpdateCreateReportAssets({
id: this.props.id, data: JSON.stringify(this.response.jsonObject) })
})




Attachment: Syncfusionspreadobject_1a381c6a.zip



JS Janakiraman Sakthivel Syncfusion Team July 10, 2021 02:43 AM UTC

Hi  Arul Lakshmanan, 
 
Thank you for your update. 
 
We have checked with the provided JSON  and we are not able to replicate this in our end. If this issue is not replicated in our end, we are not able to validate this in our end. So, if possible, please share the exact root cause of this issue. For your convenience, we have prepared the sample and video demonstration of this. Please find the link below. 
 
 
 
So before that we would like to let you know the following details to proceed further. 
 
1. If you have done any customization in sample level, please share the codes to replicate the issue in our end. 
 
2. If possible please replicate your issue in the above sample and send back to us. 
 
3. if possible please share us the video demonstration of the reported problem.  
 
Could you please check the above link and get back to us, if you need any further assistance on this. 
 
Regards, 
Janakiraman S. 



AL Arul Lakshmanan July 13, 2021 08:03 AM UTC

Hi Janakiraman,

Thank you for your update.


We are importing data into our component using below methods and using id's instead of reference. when use ref it is working fine but it's not working for id's. below i am attaching video reference, can you please check it.

const compId = 'spreadsheet-' + this.props.id
const spreadsheetEditor = document.getElementById(compId).ej2_instances[0]
spreadsheetEditor.openFromJson({file: typeof this.props.data === 'string' ?
JSON.parse(this.props.data) : this.props.data })



<SpreadsheetComponent
id={'spreadsheet-' + this.props.id}
ref={(ssObj) => { this.spreadsheet = ssObj }}
allowEditing={componentType !== 'viewReport'}
showFormulaBar={componentType !== 'viewReport'}
showRibbon={componentType !== 'viewReport'}
>
<SheetsDirective>
<SheetDirective>
<RangesDirective>
<RangeDirective />
RangesDirective>
SheetDirective>
SheetsDirective>
SpreadsheetComponent>



Video Link: https://drive.google.com/file/d/1nhwwNAklh0lek7r-ncgbEAvs5InRK2hu/view


Regards,
Arul Lakshmanan.


JS Janakiraman Sakthivel Syncfusion Team July 15, 2021 03:32 PM UTC

Hi  Arul Lakshmanan,  
  
Thank you for your update.  
 
We imported your previously attached JSON data into our sample using id instead of reference but we are not able to replicate issue in our end. So, please share the customization related code that you have used in your end. Or else please replicate your issue in the below sample, based on that we will check and update you the further details quickly. 
 
For your convenience, we have prepared the sample and video demonstration of this. Please find the link below.  
 
 
 
Could you please check the above details and get back to us with more details, if we misunderstood your requirement or need further assistance on this. 
 
Regards, 
 
Janakiraman S. 


Loader.
Up arrow icon