• Resolved rwboyer

    (@rwboyer)


    Looking thru the forum I found a few answers to what I was trying to do. Here’s the rub: The answers are over a year old and using the EXACT same method I’m getting an error in the JS for datatables now..

    Like others I need to hide a column but still have it searchable. I have this in the custom commands field for the table:

    “columnDefs”: [ { “visible”: false, “targets”: [ 3 ] } ]

    intending to hide column 3 (4th column starting count at 0).

    This now breaks the JS for tablepress. I get the following error in the browser:

    TypeError: undefined is not an object (evaluating ‘i._DT_CellIndex={row:b,column:l}’)
    Jajquery.datatables.min.js:23:174
    Njquery.datatables.min.js:15:231
    (anonymous function)jquery.datatables.min.js:15:343
    (anonymous function)jquery.js:1:927
    mapjquery.js:1:3717
    mapjquery.js:1:894
    majquery.datatables.min.js:15:310

    Just the first few lines in the call stack.

    Any hep would be fantastic.

    RB

    https://wordpress.org/plugins/tablepress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter rwboyer

    (@rwboyer)

    also tried a different version that was posted here that was even older same results:

    “aoColumnDefs”: [ { “bVisible”: false, “aTargets”: [ 6 ] } ]

    Thread Starter rwboyer

    (@rwboyer)

    Figured out the issue:

    Hidden columns via the plugin editor are not counted/visible at all to the JS so my numbering was wonky.

    Sorry/Thanks

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.
    Also, sorry for the long wait for a reply. As a I was on a long vacation without internet access the last couple weeks, I could not reply earlier.

    Yes, the counting only applies to the actual columns that are sent to the browser. Good to hear that you already found this! 🙂

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hide column with custom command.’ is closed to new replies.