jQuery Datatables: export filter on rows and columns

1.1k views Asked by At

I am trying to export only visible columns and filtered columns to csv.

I am using

{"sExtends": "xls", "mColumns":"visible", 
"oSelectorOpts": { "filter": "applied", "order":"current"}
}

but hidden columns are still on export.

When I remove oSelectorOpts, I can see only visible columns on export. Perhaps mColumns and oSelectorOpts are conflicting?

2

There are 2 answers

0
Sandeep Garg On

As per your above mentioned options are correct and there should not arise any conflict too because oSelectorOpt mainly acts on rows and mColumns works over columns. So their operational fields are different. Might be there is something else which is conflicting or is having mistake. If possible share the url where the data-table is used and export is having issue.

0
sean On

I happened to solve this problem myself. I added sCharSet to utf16le and sFileName, then it was showing correct export result.