How to target columns and add different format to each column under exportOptions

How to target columns and add different format to each column under exportOptions

KEshav09KEshav09 Posts: 18Questions: 9Answers: 0

Hi team , so i am having a requirement where while downloading the csv file i need to format each column seperately . I have added column filters in the column headers which helps me filter the results and they start appearing in the downloaded file as well
exportOptions:{
format:{
header:function(data){
return data.replace(/<[^>]*>/g, ' ');
}
}
}
i have used this piece of code to remove the html tags but the data that is there in the header the values of these html tags seem to be appearing in the table headers when i download the csv file
and i also i want to change the name of the table headers for specific columns to specific names

exportOptions:{
format:{
header:function(data){
return index === 5 ? "Transaction Type" : content;
}
}
}

i can use this code to do that but this should not be for all columns only for specific ones
how can i achieve this using exportOptions as i can see i can use only one exportOptions object for a button and only one formatting object for the same

how can i target different columns and add different exportoptions to each one of them

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    You would use orthogonal data for the column data. Take a look at this example from this thread, it's showing how to change the checkbox appearance - not the same, but it should give you a direction,

    Colin

  • KEshav09KEshav09 Posts: 18Questions: 9Answers: 0

    Thank you so much @colin

Sign In or Register to comment.