Is a render function required to return orthogonal data to Buttons?
Is a render function required to return orthogonal data to Buttons?
ChrisMiami
Posts: 7Questions: 3Answers: 0
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, theorthogonal
option takes a string value. It does not take an object.You could set
orthogonal
to benull
, and assuming that your rendering function will return the original data if a type ofnull
is passed in, then it should work. Alternatively set it to beexport
or 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
orthogonal
property of theexportOptions
object will be passed as-is to therender(data,type)
function as thetype
argument. So, if you're testing for strings already, it's best NOT to create an anonymous object with adisplay
property, but just setorthogonal: 'export'
-- or whateverString
you 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