dt3 export issues
dt3 export issues
Hi Allan.
Started integrating dt3, thank you.
Amazingly smooth so far.
A minor issue is that there seems to be no screen message indicating how many rows are copied with Copy button, which I've grown accustomed to seeing in dt2.
A bigger issue is that when I try to exclude a column with the exportOptions{}, I get error below:
Error message: "Uncaught SyntaxError: Failed to execute 'matches' on 'Element': ':not(.label):visible' is not a valid selector"
If I just use ':visible', no problem.
Here is link to my test case: Export Selector Issue - dt3.0
Click Copy, function works but without message.
Click CSV - Visible, all good.
Click CSV - Visible Not Label, fails giving above error.
Only other issue so far is that your old plugin order.neutral() does not work with dt3. For now, I've just set that aside.
Let me know if code issue (or me).
Thank you again, c
Replies
Rewriting the selector seems to fix issue:
I've added a 4th button to test case ... Export Selector Issue - dt3.0
Click CSV - Visible Not Label [Fixed], all good.
Let me know if you support this approach.
Thanks!
c
PS. I also updated the order.neutral() plug-in ...
https://cdn.datatables.net/plug-ins/3.0.1/api/order.neutral().js
My bad for not checking.
Works now with dt3.
Thank you!
c
Hi,
is the same as:
i.e. you can't have two parameters with the same name in the object - the second will "win". So it might not be doing exactly what you expect at the moment.
The lack of a
:visibleselector is a bit of a problem, and I'm not yet certain how to address that. I most certainly don't want to use a custom selector engine like jQuery does, but there does need to be a way to handle this. One option could be adding a class to hidden header elements, which would be the:visiblepart can be updated to be:not(.is-hidden)or something like that.Good to hear that you got
order.neutral()working with the latest plugins.Allan
Thank you. Bummer. As you noted, my earlier approach did not work in our production version.
Followed your recommendation to add class to headers (columns) to be exported.
I add 'export' class to all visible columns, then exclude as appropriate.
Then,
Here is link to updated test case: Export Selector Issue - dt3.0 [rev1]
Click Export, then CSV Visible Export [Fixed].
It includes all visible columns but excludes the column with class label.
More complex, but does the job ... I verified this approach now works on production version.
Thank you!
c
couple quick follow ups ...
1) note sure why fileName is coming out 'null' in csv export, even though it is specified with
2) do you intend to add back the screen message indicating how many rows are copied with Copy button?
c
1) It should be
filename, notfileName. The docs have the correct name (although possibly is it wrong somewhere else?).2) Yes, that is a bug. Thanks for letting me know about it. I've committed a fix which will be in the next patch for Buttons, which I'll make to release it tomorrow.
Allan
thank you!