Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nelson 94 posts 246 karma points
    Jan 12, 2016 @ 03:32
    Nelson
    0

    Make an entire cell clickable

    Hello guys,

    I'm trying to find a solution to make an entire cell in a row clickable to other page. I've tried creating a grid editor for that, but so far it's not working. Is there any simpler way to do this?

    Thanks in advance!

  • TheOriginal 22 posts 122 karma points
    Jan 13, 2016 @ 13:43
    TheOriginal
    0

    You could try using javascript/jquery, by adding a .click function where it does what ever you want

  • Joel 23 posts 108 karma points
    Sep 27, 2017 @ 01:29
    Joel
    0

    Did you ever find the solution to this? If so, how did you do it?

  • Duncan Bannister 5 posts 76 karma points notactivated
    Oct 06, 2017 @ 12:48
    Duncan Bannister
    0

    Hi Nelson

    I assume you are talking about a table. If not please can you provide a detailed description of what your objective is and maybe provide some code.

    You could try something like this:

    HTML:

    <table>
      <tr>
        <th>Company</th>
        <th>Contact</th>
        <th>Country</th>
      </tr>
      <tr class="clickable-row" data-pageurl="https://www.w3schools.com">
        <td>Alfreds Futterkiste</td>
        <td>Maria Anders</td>
        <td>Germany</td>
      </tr>
      <tr class="clickable-row" data-pageurl="https://www.w3schools.com">
        <td>Centro comercial Moctezuma</td>
        <td>Francisco Chang</td>
        <td>Mexico</td>
      </tr>
    </table>
    

    Jquery:

    <script>
     $(function(){
       $(".clickable-row").on("click", function(){
         var pageUrl = $(this).data("pageurl");
         $(window).attr("location", pageUrl);
       });
     });
    </script>
    

    Here are the resources I used :

  • Joel 23 posts 108 karma points
    Oct 06, 2017 @ 20:23
    Joel
    0

    I assume the OP meant by using the Umbraco GUI, not by manually hardcoding the link. The grid editor in this instance doesn't allow the cell (div) to be wrapped in an a href tag. I think Leblender or another approach is necessary unless the grid editor can be updated to allow the contentpicker datatype to be applied to the cell.

Please Sign in or register to post replies

Write your reply to:

Draft