Skip to main content

Notifications

Power Pages - Customize & Extend
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:
  • Suggested answer
    oliver.rodrigues Profile Picture
    oliver.rodrigues 8,962 on at
    Apply Javascript in modern Lists
    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
  • Suggested answer
    ZackS Profile Picture
    ZackS 74 on at
    Apply Javascript in modern Lists
    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.

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,215

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,290

Leaderboard

Featured topics