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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Drag and Drop PCF Comp...
Power Apps
Answered

Drag and Drop PCF Component

(0) ShareShare
ReportReport
Posted on by 674
Has anyone used Scott Durow's PCF Drag and Drop component? GitHub - scottdurow/power-drag-drop   I have followed his YouTube video for setting up a task scheduler, and have a working test model.  However, his video did not explain how to set up and size the nested containers. I made some guesses and have my app working, but would like to change the display from landscape to portrait, reduce the number of dates across the top, and then resize the containers to fit.
 
Any input or examples would be helpful. I am also happy to share what I have done so far. Fairly crude, but it works.
 
Thanks.
 
Categories:
I have the same question (0)
  • Verified answer
    SaiRT14 Profile Picture
    1,990 Super User 2025 Season 1 on at
     
     
    In the custom PCF component, the width and height of each container should be dynamically calculated using:
    let containerWidth = Parent.Width * 0.8; // For example, using 80% of the screen width
    let containerHeight = Parent.Height * 0.6; // For example, using 60% of the screen height
     
    Consider using Flexbox to handle the dynamic resizing and layout arrangement of the containers.
    .container {
      display: flex;
      flex-direction: column;  /* Switch to column for portrait mode */
      justify-content: space-around;  /* Distribute space evenly between items */
    }
     
    In your code where you set the dateContainer or loop over the list of dates
    let dateRange = dates.slice(0, 7);  // Show only 7 days
     
    For portrait mode, you might want to stack the dates vertically
    .dates-header {
      display: flex;
      flex-direction: column; /* Stack dates vertically in portrait */
    }
     
    You can use the Container.Width and Container.Height properties dynamically to fit the content
    containerWidth = Parent.Width / 2;  // Adjust width to half the screen
    containerHeight = Parent.Height / 3;  // Adjust height to fit 3 items vertically
     
    pls try.
     
    thanks
     
  • 55552 Profile Picture
    674 on at
    Thanks for the detailed response. If I use the FlexBox method to size the containers, where would I put that code (appears to be HTML).  I do not see a place for a template or HTML template in the container properties.
  • jsmith87 Profile Picture
    297 on at
    @55552 Hi, did you ever manage to finish this project? I'm trying to do it now and I'm on the third video where you can save drag and drop items but I'm stuck on one particular thing (where varSelectedDate) was set from. Wondering if you're able to shed some light on to it?
  • 55552 Profile Picture
    674 on at
    @jsmith87   Yes, I have it working. Please send me more details, screenshots, or code snippets so I can answer your question.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 105 Most Valuable Professional

#2
Haque Profile Picture

Haque 77

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 70

Last 30 days Overall leaderboard