Is a render function required to return orthogonal data to Buttons?
Is a render function required to return orthogonal data to Buttons?
Following the workaround presented in this discussion, I have set the buttons property of my table declaration as follows:
buttons: [ { extend:'excel', exportOptions: {orthogonal: {display:':null'}}},
{ extend:'copy', exportOptions: {orthogonal: {display:':null'}}},
{ extend:'pdf', exportOptions: {orthogonal: {display:':null'}}}
] ,
However, I'm still getting rendered data and not raw data, even for columns for which there's a render function returning raw data for sorting.
Do I need to add code in the render(data,type) function to test type for that ':null' string?
Thanks,
Chris
This discussion has been closed.
Answers
C'mon Community, just a yes or no answer's all I need. I know someone's gotta have this working somewhere!
Actually, looking back at my comment in the thread you linked to, I don't think that will work at all. As the documentation for
buttons.exportData()notes, theorthogonaloption takes a string value. It does not take an object.You could set
orthogonalto benull, and assuming that your rendering function will return the original data if a type ofnullis passed in, then it should work. Alternatively set it to beexportor similar and update your rendering function to return the required data when the export type is requested.Regards,
Allan
Well. The short answer is YES.
I will post next week the kind of documentation I wish I'd been able to find, but for now, the basic answer is that whatever you assign to the
orthogonalproperty of theexportOptionsobject will be passed as-is to therender(data,type)function as thetypeargument. So, if you're testing for strings already, it's best NOT to create an anonymous object with adisplayproperty, but just setorthogonal: 'export'-- or whateverStringyou want to check for in yourrender().As I said, I'll post more detail next week.
Thanks for nothing, ya hockey pucks! ;-) (RIP Don Rickles)
Chris
Yup - that is in the docs, but it isn't obvious! I need to find a better way to make them flow more conceptually - particularly the
exportOptions.Allan