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 / How to change the href...
Power Pages
Answered

How to change the href attribute in hyperlink tag using JQuery on Subgrid

(0) ShareShare
ReportReport
Posted on by 105

I have a subgrid (from the contact table) featuring four columns. The initial column is a lookup originating from the account table, while the fourth includes dropdown item controls, such as "view details." Clicking on "view details" opens a new page with the URL that includes the ID and the record's relationship. My goal is to extract each account GUID from the lookup column and append it to each dropdown's hyperlink. This modification will enable me to display a subgrid of the account table on the subsequent page by appending the account to the URL.

 

/*
 This code appends the Organization GUID to the dropdown menu's <a>.

*/
$(document).ready(function () {
 $('.entity-grid.subgrid').on('loaded', function () {
 $(this)
 .children('.view-grid')
 .find('tbody tr')
 .each(function (i, e) {
 var orgId = $(this).find('td[data-attribute="rsp_assignedtoid"]:first').data('value').Id;
 var originalHref = $(this).find('td:last a').attr('href');
 var newHref = originalHref + '&oid=' + orgId;
 $(this).find('td:last a').attr('href', newHref);
 });
 });
});

 

I've attempted the provided code and explored alternative implementations, but it doesn't appear to be functioning. I would appreciate any assistance or guidance.

Categories:
I have the same question (0)
  • Verified answer
    aofosu Profile Picture
    105 on at

    I changed the subgrid control to a list control and it works. 

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 74 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard