Open SPFX webpart as modal dialog in another spfx webpart

Athulya Pillai 46 Reputation points
2022-07-06T07:54:08.207+00:00

Hello Team,
I have created a form in spfx which adds data to a List.
Now i have created another spfx webpart with a link. Click on this link should open the above spfx (webpart) form in a modal dialog.
Is this possible.Could you please help me with any example

Thanks
Athulya

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,214 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 29,116 Reputation points Microsoft Vendor
    2022-07-07T06:33:34.027+00:00

    Hi @Athulya Pillai ,
    Per my test, we are unable to open a spfx webpart in another webpart. we can only connect them with dynamic data like following document
    https://learn.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-data
    I feel regretful to inform you that it turns out to be a by-design one. As a workaround, I will suggest you to use custom dialog boxes with SharePoint Framework Extensions. You can make a reference to the following document
    https://learn.microsoft.com/en-us/sharepoint/dev/spfx/extensions/guidance/using-custom-dialogs-with-spfx


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.