function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andy Freeston_LarterAndy Freeston_Larter 

Modal popups

Hi,
 
I need to display a Lightning Component in a modal popup form, just like when you click Edit on an Opportunity or Account page. From reading the Aura source code I can see that I need to make use of ui:panel and/or ui:modal as these implement the LDS concept of “Modals” and take care of hiding the page’s scrollbar. I can’t find any examples of how to use them from inside Lightning or Visualforce.
 
Can anyone assist?
 
Thanks.

- Andy
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
I wrote a blogpost  on how to do this via lightning components

http://cloudyworlds.blogspot.com/2016/02/opening-modals-using-lightning.html

Also my colleague Jitendra also wrote on how to do this

http://www.jitendrazaa.com/blog/salesforce/dynamically-instantiate-and-destroy-lightning-components-modal-dialog-component/

Hope that gets you some insight into how to achieve this .
Andy Freeston_LarterAndy Freeston_Larter
Thanks for responding. In both cases the code is using LDS to solve the visual layout of the modal component – that’s the easy bit. If you look at the source code for ui:modal you can see it handles much more, transition animation, focus handling, and most importantly the page body scrollbar.
 
I was wondering if anyone had found a solution that used the native Lightning component ui:modal?
 
Thanks again.