Get Free Trial

How to export data without customized cell content?

Serhii asked on October 26, 2020

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

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:
Please let us know if it works for you and if any other questions arise.
Best regards,

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,

Serhii November 11, 2020

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

Please login or Register to Submit Answer