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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Apply Javascript in mo...
Power Pages
Suggested Answer

Apply Javascript in modern Lists

(1) ShareShare
ReportReport
Posted on by 2
Hello I'm able to apply Javascript in the old Lists, using this kind of code inside the list 
$(document).ready(function() {

      $(".entitylist.entity-grid").on("loaded", function() {
....
      }
}

But when I try  the new moden lists  it's not calling the Javascript , I also saw that the new list is a react componant that loads as a set of div elements , I cannot figure out a way to call the JS inside the lists !
 
 
Categories:
I have the same question (0)
  • Suggested answer
    ZackS Profile Picture
    112 on at
    Are you putting the javascript inside of the list or inside of the page? I've noticed I get better results when I put the javascript inside of the page.
  • Suggested answer
    oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at
    Adding JS to PCF or modern controls are extremely difficult to be honest, I only use a modern list component if I am 100% sure that I won't need any customizations applied to it.
     
    For other simpler PCF components, I have used Mutation Observer concept to listen to the change of the control, this might work for Modern Lists as well (I haven't tried myself) - https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 34

#2
Valantis Profile Picture

Valantis 30

#3
omkarsupreme Profile Picture

omkarsupreme 23

Last 30 days Overall leaderboard