Background
In Power Pages (formerly known as Power Apps portals), Entity Lists often present clickable hyperlinks on the first column. While this is convenient for navigation to detailed records, sometimes you might want to display this information as plain text instead. For example, you may have a “Case Number” or “Grievance Number” column that you want visible, but not clickable.
The out-of-the-box configuration may not allow you to disable these links directly. Luckily, you can accomplish this by adding a small amount of custom JavaScript to your Web Page. By leveraging a MutationObserver
, you can wait until the list fully loads and then remove the hyperlink while retaining the text.
What You Need to Know
- Column Text Selector: Identify the exact text used in the column header. In the script below, we use
data-th="Grievance Number"
as a selector. Update this to the actual column text from your list. - Link Selector: The default link inside these cells usually has the CSS class
.details-link
. You can confirm this by using your browser’s developer tools to inspect the rendered list. Update if needed. - Implementation Location:
Add this script to the “Custom JavaScript” section on the Options tab of your List.
Sample Code
Replace "Grievance Number"
with the text of your column header. If your first column is “Case Number,” use that text instead. Additionally, confirm that the .details-link
class exists by inspecting your rendered HTML (as shown in the example <a>
tag below).
Verifying the Changes
- Navigate to your published page containing the Entity List.
- Inspect the first column. Previously clickable text should now appear as static text.
- If it still appears as a link, double-check that you have the correct column header text and that the
.details-link
class is present on the generated links.
Conclusion
By using this small JavaScript snippet, you gain finer control over how Entity List columns are presented, ensuring that certain fields remain non-clickable while still providing valuable information to your users.
No comments:
Post a Comment