• Resolved jfbprivate

    (@jfbprivate)


    Hi Tobias,

    After having set up a clickable row with JavaScript (like explained here: https://www.ads-software.com/support/topic/make-row-clickable/), I created an additional (hidden) column that holds the URL. I could, of course, use “href” in one of the other columns but it’s way easier to copy and paste the URL in an extra one rather than having to edit hundreds of entries.

    Now I’m trying to figure out how to target the link in that particular hidden column, just like I did with sorting in another example:

    “columnDefs”: [ { “orderData”: [ 0 ], “targets”: [ 1 ] }, { “visible”: false, “type”: “date”, “targets”: [ 0 ] } ]

    The respective table has a total of 5 (4 visible + 1 invisible) columns, and I need any clicks to go to the URL from the hidden last column (#5).

    Do you have a solution ready, or could you put me in the right direction for me to try out myself?

    Many thanks!

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The first question here is how you are hiding that column: Via the controls on the “Edit” screen of the table (so that the column is now marked with a red background color)? If so, that will not work, as the column is then not sent to the browser. You should hide it with CSS code instead, like

    .tablepress-id-123 .column-5 {
      display: none;
    }

    Then, the mentioned “Custom Command” has nothing to do with this. You’d instead have to modify the JavaScript code that you are using to trigger the click on the link. It would need to have to extract the URL from the last cell in the row and then navigate there.

    Regards,
    Tobias

    Thread Starter jfbprivate

    (@jfbprivate)

    Hi,

    Apologies for the late reply, and thanks for clearing that up.

    I’m not JavaScript-savvy enough to come up with anything myself. Any suggestions where I could find appropriate help?

    Thanks again.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    but aren’t you already using the JS code from the link that you pasted? That’s what you could use a starting point. Unfortunately, I don’t know a directly usable solution, sorry.

    Regards,
    Tobias

    Thread Starter jfbprivate

    (@jfbprivate)

    Yeah but I have no idea how to modify it. No worries I will find a solution.

    As always, thank you for your time!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    sure, no problem!

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to Target URL From Hidden Column in Clickable Row’ is closed to new replies.