Need a special offer?Find out if your project fits.
+

How to export data without customized cell content?

Answered
Serhii asked on October 26, 2020

Hello,
I have an issue with exporting data after cells have been customized.
There are buttons added into cell using "customizeCell" method and via "cell.text" property. Something like this:

customizeCell = (cell, data) => {
if (cellDataHasOneWord()) {
cell.text += '<button onclick="displayDialog(\'' + data.rows[0].caption + '\')">Display Dialog</button>'
}
}

But after that using export functionality leads to redundant text in this cell, for example "Name1 Display Data" instead of "Name1".
Is there any way to remove this unnecessary text from the exported file?

3 answers

Public
Milena Pechura Milena Pechura Flexmonster October 27, 2020

Hello, Serhii,
 
Thank you for your question.
 
To remove the customization from the cells in the exported file, we suggest invoking customizeCell with the null parameter on exportstart event and with the customizeCellFunction parameter on exportcomplete. Please kindly note that this approach works for every export format except an image.
 
We have prepared an example for illustration: https://jsfiddle.net/flexmonster/me08kdwa/.
 
Please let us know if it works for you and if any other questions arise.
 
Best regards,
Milena

Public
Milena Pechura Milena Pechura Flexmonster November 11, 2020

Hi, Serhii,
 
We were wondering if our response helped you with your question.
Could you please let us know if the suggested approach works for you?
 
Looking forward to your response.
 
Kind regards,
Milena

Public
Serhii November 11, 2020

Hi Milena,
 
Your answer helped, solved my issue.
 
Thanks a lot!

Please login or Register to Submit Answer