web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Make the entire row of...
Power Pages
Answered

Make the entire row of list table clickable

(0) ShareShare
ReportReport
Posted on by 75

Hi, So I have a requirement that the whole row should be clickable

ThareLyn_0-1624502115700.png

The first cell (blue font) is the only clickable part of the row, which it will redirect to new page for more details of the record.

I need to make the whole row act the same as the 1st cell.

Is there a ootb for this? if now how can I achieve this requirement? Thank you.

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    There is no way OOB to achieve this, what you need to do is apply JS and add the link to every <td> from the table.

     

     

  • Verified answer
    oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Please take a look at this JS that might help you:

    $(document).ready(function () {
     SetLinkAllCells();
    });
    
    SetLinkAllCells = function () {
    
     var entityList = $(".entitylist.entity-grid").eq(0);
    
     entityList.on("loaded", function () {
     entityList.find("table tbody > tr").each(function (index, tr) {
     
     var primaryColumn = $(tr).find('td')[0];
    
     /// or retrieve column by name
     /// var primaryColumn = tr.find('td[data-attribute="name"]');
    
     var url = $(primaryColumn).find("a")[0].href;
     console.log("URL: " + url);
     if (!!url) {
     $(tr).find('td').each(function (index, td) {
     /// ignore action menu / dropdown
     if ($(td).attr("aria-label") == "action menu")
     return;
    
     var cellValue = $(td).text();
     /// clear td value 
     $(td).text("");
     var newElement = '<a href="' + url + '" class="details-link has-tooltip" data-toggle="tooltip">' + cellValue + '</a>';
     $(td).append(newElement);
     });
     }
     });
     });
    };
  • v-albai-msft Profile Picture
    on at

    Hi @ThareLyn ,

    Yes, totally agree with @OliverRodrigues that at least for now, there is no OOTB to achieve this.

    You may have a try with @OliverRodrigues 's code.

    Best regards,

    Allen

  • DylanR Profile Picture
    50 on at

    Hi @OliverRodrigues 
    Thanks for sharing. I have the same need, but cannot get your shared script to work. I would really appreciate if you could review my example below and amend where I have gone wrong.
    Thanks so very much!

     

    $(document).ready(function () {
     SetLinkAllCells();
    });
    
    SetLinkAllCells = function () {
    
     var entityList = $(".opportunity.myform").eq(0);
    
     entityList.on("loaded", function () {
     entityList.find("table tbody > tr").each(function (index, tr) {
     
     var primaryColumn = $(tr).find('td')[0];
    
     /// or retrieve column by name
     /// var primaryColumn = tr.find('td[data-attribute="name"]');
    
     var url = $(primaryColumn).find("name")[0].href;
     console.log("https://myorg.powerappsportals.com/MyList/" + url);
     if (!!url) {
     $(tr).find('td').each(function (index, td) {
     /// ignore action menu / dropdown
     if ($(td).attr("aria-label") == "action menu")
     return;
    
     var cellValue = $(td).text();
     /// clear td value 
     $(td).text("");
     var newElement = '<a href="' + url + '" class="details-link has-tooltip" data-toggle="tooltip">' + cellValue + '</a>';
     $(td).append(newElement);
     });
     }
     });
     });
    }
  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @DylanR 

     

    Are you getting any errors? Please confirm where did you add the script. If it is on the page you need to add under localised content> custom Javascript 

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • DylanR Profile Picture
    50 on at

    Hi @ragavanrajan 

    Thanks for the speedy reply. I'm not getting any errors.

     

    Here is where I have added the script.

     

    DylanR_0-1628830224608.png

     

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    huh! 

    Please try adding it under Localize Content 

     

    In portal management 

    1.Web pages > your web page > scroll down Localized content 

    2. Advanced > Custom Javascript 

     

    ragavanrajan_0-1628830490370.png

    In portal studio 

     

    1. Sync configuration and Browse website 

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

  • DylanR Profile Picture
    50 on at

    Hi @ragavanrajan 

    I have added it to the location you've given and still no success. Is my script correct? It doesn't give any indication that it has attempted to run on page load.

     

     

    $(document).ready(function () {
     SetLinkAllCells();
    });
    
    SetLinkAllCells = function () {
    
     var entityList = $(".opportunity.clientquestionnaire").eq(0);
    
     entityList.on("loaded", function () {
     entityList.find("table tbody > tr").each(function (index, tr) {
     
     var primaryColumn = $(tr).find('td')[0];
    
     /// or retrieve column by name
     /// var primaryColumn = tr.find('td[data-attribute="name"]');
    
     var url = $(primaryColumn).find("name")[0].href;
     console.log("https://myorg.powerappsportals.com/Client-Questionnaire/" + url);
     if (!!url) {
     $(tr).find('td').each(function (index, td) {
     /// ignore action menu / dropdown
     if ($(td).attr("aria-label") == "action menu")
     return;
    
     var cellValue = $(td).text();
     /// clear td value 
     $(td).text("");
     var newElement = '<a href="' + url + '" class="details-link has-tooltip" data-toggle="tooltip">' + cellValue + '</a>';
     $(td).append(newElement);
     });
     }
     });
     });
    }
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    hi @DylanR might be a bit confusing, but whenever we create a Web Page, there is an OOB plugin that duplicates that Web Page, creating what we call a "Localized Content Web Page".. this is because the Portals support multiple language, so each Web Page will always contain:

    • 1 main/root Web Page
    • 1 localized/content Web Page per each language

    Any JS code should be placed in the Localized Content one, if you open your root Web Page, you will see the below sub-grid:

    OliverRodrigues_0-1628841736181.png

    Place the JS on that one and see if you have any luck

  • DylanR Profile Picture
    50 on at

    Hi @OliverRodrigues 

    Thank you for your reply. I have added it to that location as below snippets show. I'm not sure if I've missed something in the script? The script doesn't run at all.

     

    DylanR_0-1628843975813.png

     

    DylanR_1-1628844044925.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard