dt3 export issues

dt3 export issues

chboccachbocca Posts: 120Questions: 16Answers: 1
edited August 15 in Buttons

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

  • chboccachbocca Posts: 120Questions: 16Answers: 1
    edited 2:26PM

    Rewriting the selector seems to fix issue:

    exportOptions: { columns: [ ':not(.label)' ], columns: [ ':visible' ] }
    

    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

  • chboccachbocca Posts: 120Questions: 16Answers: 1

    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

  • allanallan Posts: 65,898Questions: 1Answers: 10,965 Site admin

    Hi,

    {
      columns: [ ':not(.label)' ],
      columns: [ ':visible' ]
    }
    

    is the same as:

    {
      columns: [ ':visible' ]
    }
    

    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 :visible selector 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 :visible part 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

Sign In or Register to comment.