Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    How are you hiding your first column here? Note that you can not hide it via the “Hide” button on the “Edit” screen. It must be hidden via that JS command.
    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Thread Starter AllanPedersen

    (@allanpedersen)

    Thanks for the quick reply.

    I’m assuming that it is the { “bVisible”: false, “aTargets”: [ 0 ] } ] command that hides it.

    Im not able to link to it because it is running internal. I can supply you with screendumbs or sourcecode.

    Thread Starter AllanPedersen

    (@allanpedersen)

    I think i understood you question now.

    I hide it from the Custom Commands in the Features of the Datatables Javascript Library. There i added

    “aoColumnDefs”: [ { “iDataSort”: 0, “aTargets”: [ 1 ] }, { “bVisible”: false, “aTargets”: [ 0 ] } ]

    Image

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    correct, that’s the code that’s hiding the column. The other part of the code tells the JS library to use the data from column 0 when the user wants to sort column 1.

    Just to be sure: Are you using the latest version of TablePress? The code changed there slightly (due to an updated version of the DataTables JS library), but the old format is converted automatically, whenever the table is saved.

    Screenshots and source code won’t really help, unfortunately, as I’d need to inspect the page with the browser developer tools :-/

    Regards,
    Tobias

    Thread Starter AllanPedersen

    (@allanpedersen)

    Im using Version 1.5.1 of TablePress and Version 1.0 of the DataTables Sorting extention.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    for which data format are you using the DataTables Sorting Plugins Extension? Can you try without that?

    Regards,
    Tobias

    Thread Starter AllanPedersen

    (@allanpedersen)

    Hi again,

    I have made a test site with a test table that shows you the issues im having:

    https://testsite.klisterpapir.dk/

    Allan

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Allan,

    thanks for the link!

    I did some testing, and it might be possible that we are running into a tiny issue with the data type of the "orderData" parameter, see https://datatables.net/forums/discussion/comment/63908/#Comment_63908

    The fix might be as easy as making the integer value an array. Can you therefore please try again with

    "aoColumnDefs": [ { "iDataSort": [ 0 ], "aTargets": [ 1 ] }, { "bVisible": false, "aTargets": [ 0 ] } ]

    Regards,
    Tobias

    Thread Starter AllanPedersen

    (@allanpedersen)

    Hi Tobias,

    Looks like I’ll be buying the beer next time I’m in Magdeburg….

    Seems to be working perfect now!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Sorting with hidden column’ is closed to new replies.