+ Start a Discussion
YiQin HeYiQin He 

How to close lightning quick action modal dialog

Hi, 

I created a lightning component as a quick action button. In the component, I have a cancel button that I want it closed when user clicks.
User-added image

But the problem is that I cannot find any document explain how to close the modal dialog. This is the ui code:
<aura:component controller="ContactController" implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
    <style>
        .changeRecordTypeRow {
        margin-top: 1.5rem;
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        }
        
        .changeRecordTypeLeftColumn {
        float: left;
        text-align: right;
        padding-right: 1.5rem;
        width: 35%;
        font-size: .8125rem;
        color: rgb(84, 105, 141);
        }
        
        .changeRecordTypeRightColumn {
        float: right;
        text-align: left;
        width: 65%;
        }
        
        .modal-body
        {
        	height:auto !important;
        	padding:0;
        }
        
        .forceChatterLightningComponent .bodyWrapper{height:100%;width:100%;padding:0;box-sizing:border-box}
    </style>
    <div class="modal-header slds-modal__header">
        <h2 class="title slds-text-heading--medium" >Change Contact Type</h2>
    </div>
    <div class="scrollable slds-modal__content slds-p-around--medium">
        <div class="changeRecordTypeRow">
            <fieldset class="slds-form-element">
                <div class="changeRecordTypeLeftColumn">
                    <legend class="form-element__legend slds-form-element__label">Select a record type</legend>
                </div>
                <div class="changeRecordTypeRightColumn slds-form-element__control">

                    <span class="slds-radio">
                        <input type="radio" id="radio_PrimaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_PrimaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Primary Contact</span>
                        </label>
                    </span>
                    <span class="slds-radio">
                        <input type="radio" id="radio_SecondaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_SecondaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Secondary Contact</span>
                        </label>
                    </span>
                </div>
            </fieldset>
        </div>
	</div>
    <div class="modal-footer slds-modal__footer">
    	<div class="forceChangeRecordTypeFooter">
        	<button type="button" class="slds-button slds-button--neutral .slds-modal__close" aura:id="btnCancel" >
            	Cancel
            </button>
            <button type="button" class="slds-button slds-button--brand" aura:id="btnSave">
            	Save
            </button>
        </div>
    </div>
</aura:component>
Does anyone have similar experience? Thanks in advance.
Best Answer chosen by YiQin He
YiQin HeYiQin He
Hi Karthik,

Thanks for the reply. I've already found the solution.
Call this method $A.get("e.force:closeQuickAction").fire() will close the modal dialog.

Yiqin

All Answers

karthikeyan perumalkarthikeyan perumal
Hello 

Try Below Code: 
 
<aura:component controller="ContactController" implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
    <style>
        .changeRecordTypeRow {
        margin-top: 1.5rem;
        margin-bottom: 0;
        margin-left: 0;
        }
        
        .changeRecordTypeLeftColumn {
        float: left;
        text-align: right;
        padding-right: 1.5rem;
        width: 35%;
        font-size: .8125rem;
        color: rgb(84, 105, 141);
        }
        
        .changeRecordTypeRightColumn {
        float: right;
        text-align: left;
        width: 65%;
        }
        
        .modal-body
        {
        	height:auto !important;
        	padding:0;
        }
        
        .forceChatterLightningComponent .bodyWrapper{height:100%;width:100%;padding:0;box-sizing:border-box}
    </style>
    <div aura:id="MainDiv" class="slds-modal__container">
    <div class="modal-header slds-modal__header">
        <h2 class="title slds-text-heading--medium" >Change Contact Type</h2>
    </div>
    <div  class="scrollable slds-modal__content slds-p-around--medium">
        <div class="changeRecordTypeRow">
            <fieldset class="slds-form-element">
                <div class="changeRecordTypeLeftColumn">
                    <legend class="form-element__legend slds-form-element__label">Select a record type</legend>
                </div>
                <div class="changeRecordTypeRightColumn slds-form-element__control">

                    <span class="slds-radio">
                        <input type="radio" id="radio_PrimaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_PrimaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Primary Contact</span>
                        </label>
                    </span>
                    <span class="slds-radio">
                        <input type="radio" id="radio_SecondaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_SecondaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Secondary Contact</span>
                        </label>
                    </span>
                </div>
            </fieldset>
        </div>
	</div>
    <div class="modal-footer slds-modal__footer">
    	<div class="forceChangeRecordTypeFooter">
        	<button type="button" class="slds-button slds-button--neutral .slds-modal__close" aura:id="btnCancel" Press={!c.removeCSS} >
            	Cancel
            </button>
            <button type="button" class="slds-button slds-button--brand" aura:id="btnSave">
            	Save
            </button>
        </div>
    </div>
  </div>
</aura:component>

in Controller add Below Method

removeCSS: function(cmp, event) {
        var cmpTarget = cmp.find('MainDiv');
        $A.util.removeClass(cmpTarget, 'slds-modal__container');
    }

Hope it will help you. 

Thanks
Karthik 
 
YiQin HeYiQin He
Hi Karthik,

Thanks for the reply. I've already found the solution.
Call this method $A.get("e.force:closeQuickAction").fire() will close the modal dialog.

Yiqin
This was selected as the best answer
Tech ModTech Mod
List of all the best websites (https://codertrick1.blogspot.com/) on the internet. 1. Technology (https://www.techrado.com) Techrado is the latest tech and new site for multi niche. 2. Techmod (https://techmod.org) Techmod provides review about different products. 3. Techpend (https://techpend.com) Techpend is the biggest and best alternative to these sites. 4. Auto Insurance Quotes (https://autoinsurancequotes.pro/) Auto Insurance Quotes is the best site for insurance quotes.
Ladle BhaiLadle Bhai
mark khanmark khan
Thanks for the post. 
Here the list of top Movies and TV Shows APK
https://apkpureapp.com/
https://www.livenettv.vip/​​​​​​​ (https://www.livenettv.vip/)
https://tvzion.me/​​​​​​​ (https://tvzion.me/)
http://typhoontv.me/​​​​​​​ (http://typhoontv.me/)
http://www.theaterplus.me/​​​​​​​ (http://www.theaterplus.me/)
mark khanmark khan
Download Yowhatsapp Apk which is similar to official Whatsapp but yowhatsapp has some extra features which is not in Official.
You can Visit fir More Info :- YoWhatsapp 8.12 (http://yowhatsapp.info/)
apk duniyaapk duniya
This is the best website for free apk download (https://apkduniya.com)
Rahil ShanRahil Shan
change line 4 ...check here  (https://picslash.com/7starhd/)
Rahil ShanRahil Shan
Kenneth MichaelKenneth Michael
Thanks for sharing this wonderful information Latest Naija Music (http://eastnaija.com)  Davido Latest Songs (https://eastnaija.com/tag/davido/)
Hasanur KaziHasanur Kazi
If you want to download movies then 9kmovies (https://m.idealfollow.in/2020/01/7starhd.html) is the best for you. Here you can easily download free movies (https://m.idealfollow.in/2020/01/7starhd.html).
joseph farnandezjoseph farnandez
Thank you for sharing great information with us.Download fmwhatsapp (https://gbapps.net/fmwhatsapp-apk-download/) latest version And you can download other whatsapp mod like whatsapp plus ogwhatsapp gbwhatsapp etc
Milli GuiderraMilli Guiderra
Thanks for sharing such great info, 

Regards
https://www.ablogtohealth.com/
Khalid JhamondayKhalid Jhamonday
APKPuredl (https://apkpuredl.com) is a tech blog that offers premium APK for Free
my pixalmy pixal
thank you for sharing a helpful post.
good morning images (https://www.mypixal.com/good-morning-images/)
good night images (https://www.mypixal.com/good-night-images/)
good evening images (https://www.mypixal.com/good-evening-images/)
 
carl carlicarl carli
thanks for sharing this amazing one solution. 

here is a app Farming Simulator APK. It is an amazing app that can make you a real farmer in the android device. The gameplay lets you make your farm in which you can grow crops by using different equipment.

https://modsroid.com/farming-simulator-18-apk-obb-download-official-latest-version-2020
 
Cyber FlixCyber Flix
This is the latest post about this code thanks for share. https://www.relaxtv.xyz/mediabox-hd-apk/
gb modsgb mods
iam exited to see this forum here. i have a blog GB Wa (https://www.gbmods.xyz/2020/01/gb-whatsapp-latest-version-download.html) and Amazon Quiz Answers (https://funzone.game.blog)
Chester HiloouChester Hiloou
i also facing same problem at my site https://bestmachete.co/best-machete
Andy Johnson 15Andy Johnson 15
Thanks for sharing some informative tips and tricks it really help us a lot. https://stylebuzzer.com (https://stylebuzzer.com)
JAMERSON PRATAJAMERSON PRATA
satta king 37satta king 37
best site for <a title="satta king record chart" href="https://satta-king.online/">Satta king result</a>, leak number &amp; all game record charts. We provide 100% fix number direct from <a href="https://satta-king.online/gali-satta-king-record-chart-2020.php">Satta king gali</a> company which includes all famous games like <a href="https://satta-king.online/satta-king-record-chart-desawar-2020.php">Satta king Desawar</a>, Gali Satta, Ghaziabad, Faridabad, Shri Ganesh Satta, Taj Satta King, charminar and other games of Satta Market Matka is also a simple game and essentially is a form of old lottery games. Ratan Khatri was the founder of this game in the 70 century and was become popular up until the 90 century. The game is not played that much anymore mostly in the regions of North India and Pakistan. Instead, many enjoy the lottery games more so these days.
Here is an example card. satta-king.online is the no1 satta king site where you can get the fastest Satta result, <a href="https://satta-king.online/satta-king-leak-number.php">Satta king leak number</a> (confirm jodi), Old <a href="https://satta-king.online/satta-king-record-chart-ghaziabad-2020.php">Satta King ghaziabad</a>, Daily leak Jodi, Desawar Jodi, <a href="https://satta-king.online/satta-king-record-chart-faridabad-2020.php">Satta king faridabad</a>, Satta record chart, <a href="https://satta-king.online/taj-satta-king-record-chart-2020.php">Satta king taj</a>, Gali Satta result, Ghaziabad Satta Result, Satta Bazar result and 100% passing fix Jodi today.
satta king 37satta king 37
best site for Satta king result (https://satta-king.online/), leak number & all game record charts. We provide 100% fix number direct from Satta king gali (https://satta-king.online/gali-satta-king-record-chart-2020.php) company which includes all famous games like Satta king Desawar (https://satta-king.online/satta-king-record-chart-desawar-2020.php), Gali Satta, Ghaziabad, Faridabad, Shri Ganesh Satta, Taj Satta King, charminar and other games of Satta Market Matka is also a simple game and essentially is a form of old lottery games. Ratan Khatri was the founder of this game in the 70 century and was become popular up until the 90 century. The game is not played that much anymore mostly in the regions of North India and Pakistan. Instead, many enjoy the lottery games more so these days.
Here is an example card. satta-king.online is the no1 satta king site where you can get the fastest Satta result, Satta king leak number (https://satta-king.online/satta-king-leak-number.php)(confirm jodi), Old Satta King ghaziabad (https://satta-king.online/satta-king-record-chart-ghaziabad-2020.php), Daily leak Jodi, Desawar Jodi, Satta king faridabad, Satta record chart, Satta king taj (https://satta-king.online/taj-satta-king-record-chart-2020.php), Gali Satta result, Ghaziabad Satta Result, Satta Bazar result and 100% passing fix Jodi today.
Lottery Sambad 18Lottery Sambad 18
It is very easy to use the benefits of the Satta King (https://www.dehlisatta.com/), thanks for visiting us.
Aghil FarhadiAghil Farhadi
Thank its so good i like it thanks again
Download (https://rozmusic.com/)
Gbplus PlusGbplus Plus
FM WhatsApp Latest Version Download
http://gbpluss.com/download-fmwhatsapp-apk/
<a href="http://gbpluss.com/download-fmwhatsapp-apk/">fm whatsapp</a>
[url=http://gbpluss.com/download-fmwhatsapp-apk/]fm whatsapp[/url]

FM Whatsapp

GB Instagram APK Download Latest Version
http://gbpluss.com/gb-instagram/
<a href="http://gbpluss.com/gb-instagram/">GB Instagram</a>
[url=http://gbpluss.com/gb-instagram/]GB Instagram[/url]

GB Instagram

Download: Gb Plus APK is the most popular version of Whatsapp
http://gbpluss.com/gb-plus-apk-download/
<a href="http://gbpluss.com/gb-plus-apk-download/">Gb Plus APK</a>
[url=http://gbpluss.com/gb-plus-apk-download/]Gb Plus APK[/url]

Gb Plus

GBWhatsApp APK Download (Official)
http://gbpluss.com/download-gbwhatsapp-apk/
<a href="http://gbpluss.com/download-gbwhatsapp-apk/">gb whatsapp apk</a>
[url=http://gbpluss.com/download-gbwhatsapp-apk/]gb whatsapp apk[/url]

Gbwhtsapp

WhatsApp Group Links (Hourly Updates) | Join, Share
http://gbpluss.com/whatsapp-group-links/
<a href="http://gbpluss.com/whatsapp-group-links/">Whatsapp Group Link</a>
[url=http://gbpluss.com/whatsapp-group-links/]Whatsapp Group Link[/url]

WhatsappGroup Links

Instagram Plus APK Download v10.14.0 For Android (25 MB) 2020
http://gbpluss.com/instagram-plus-apk/
<a href="http://gbpluss.com/instagram-plus-apk/">Instagram Plus</a>
[url=http://gbpluss.com/instagram-plus-apk/]Instagram Plus[/url]

Instagram Plus

NSWhatsApp 3d APK Download Latest Version
http://gbpluss.com/nswhatsapp-3d-apk/
<a href="http://gbpluss.com/nswhatsapp-3d-apk/">NSWhatsApp 3d</a>
[url=http://gbpluss.com/nswhatsapp-3d-apk/]NSWhatsApp 3d[/url]

NSWhatsapp

Download OGInsta APK  Latest version 
http://gbpluss.com/oginsta-apk/
<a href="http://gbpluss.com/oginsta-apk/">OG Insta APK</a>
[url=http://gbpluss.com/oginsta-apk/]OG Insta APK[/url]

OG Insta

Download OG Whatsapp APK  Latest version 
http://gbpluss.com/download-ogwhatsapp-apk/
<a href="http://gbpluss.com/download-ogwhatsapp-apk/">og whatsapp</a>
[url=http://gbpluss.com/download-ogwhatsapp-apk/]og whatsapp[/url]

OG Whatsapp

WhatsApp Aero APK is a new released latest modified application for WhatsApp
http://gbpluss.com/download-whatsapp-aero/
<a href="http://gbpluss.com/download-whatsapp-aero/">Whatsapp Aero</a>
[url=http://gbpluss.com/download-whatsapp-aero/]Whatsapp Aero[/url]

WhatsApp Aero

WhatsApp Mix APK is known as one of a popular mod of WhatsApp.
http://gbpluss.com/whatsapp-mix-apk-download/
<a href="http://gbpluss.com/whatsapp-mix-apk-download/">safe use</a>
[url=http://gbpluss.com/whatsapp-mix-apk-download/]safe use[/url]

WhatsApp Mix

WhatsApp Plus is a very popular modded version of WhatsApp
http://gbpluss.com/latest-whatsapp-plus-download/
<a href="http://gbpluss.com/latest-whatsapp-plus-download/">whatsapp plus</a>
[url=http://gbpluss.com/latest-whatsapp-plus-download/]whatsapp plus[/url]

Whatsapp Plus

WhatsApp Transparent (GBplus) APK Download
http://gbpluss.com/gbplus-whatsapp-transparent/
<a href="http://gbpluss.com/gbplus-whatsapp-transparent/">WhatsApp Transparent</a>
[url=http://gbpluss.com/gbplus-whatsapp-transparent/]WhatsApp Transparent[/url]

WhatsApp Transparent

Download YoWhatsapp APK latest version from our site and experience 
some of the best features of Whatsapp
http://gbpluss.com/latest-yowhatsapp-apk/
<a href="http://gbpluss.com/latest-yowhatsapp-apk/">Yo whatsapp</a>
[url=http://gbpluss.com/latest-yowhatsapp-apk/]Yo whatsapp[/url]

Yo Whatsapp

http://gbpluss.com
<a href="http://gbpluss.com">Gbpluss</a>
[url=http://gbpluss.com]Gb Pluss[/url]

 
Sam Henry 9Sam Henry 9
Thank its so good i like it thanks again.
Mp3 Download (http://abokiplay.com)
Jhon Smith 25Jhon Smith 25
Tencent's Gaming Buddy, initially targeted at PUBG mobile, allows you to play Android games on your PC. By using this emulator - https://thegamingbuddy.com/tencent-gaming-buddy/
Preet Kamal 3Preet Kamal 3
thanks a lot, it works for me https://quotesbae.com
Tue Texo 3Tue Texo 3
Hey, Thanks for sharing this helpful & wonderful post. I really appreciate your hard work. this is very useful & informative for me. 
Download Latest Android Mod Apk From ModLooters (https://modlooters.com). This Is The Best Modded Apk Site Of 2020, Mod Looters Offer most popular  Modded Games and Android Apps For Free.
 
Preet Kamal 3Preet Kamal 3
the information you provide is very useful for me fake family quotes (https://preetkamal.com/32-fake-family-quotes-about-betrayal-of-friends/)
 
Preet Kamal 3Preet Kamal 3
thanks for sharing this ride or die meme (https://picssmine.com/24-ride-or-die-meme-that-make-you-laugh/)
Wynk MusicWynk Music
Thank for the post..!
Wynk Music MOD apk (https://www.wynkmusic.info/)
Steve Mitchell 35Steve Mitchell 35
Greetings! Very helpful advice within this article! 
GB WhatsApp (https://www.gbwaplus.com/gb-whatsapp/
WhatsApp Plus (https://www.gbwaplus.com/whatsapp-plus/
YO WhatsApp (https://www.gbwaplus.com/yo-whatsapp/)
Trek OathTrek Oath
Thanks to make this kind of post. 
https://sggreek.com/cyrose-movies-site-like-cyro-se-g2g/ (https://sggreek.com/cyrose-movies-site-like-cyro-se-g2g/" target="_blank)
ricky broadricky broad
Thanks for sharing
Best Programming Language for Artificial Intelligence (https://techseoblog.com/best-programming-language-for-artificial-intelligence/)
Caitlin BuckleyCaitlin Buckley
Thanks for sharing
It is the Best Programming Language for Artificial Intelligence GTA Vice City APK (https://apkcunk.com/gta-vice-city-apk/)
Sandy N 8Sandy N 8
mike wilson 23mike wilson 23
Thanks for the option given. It will really help to get the job done without any hassle.  
Regards, 
https://thenamecombiner.com/
 
Bia SilverBia Silver
Valeu Pela dicas. WhatsApp GB  (https://ogwhatsbrasil.com/gbwhatsapp-3-2)
Rajesh Jha 4Rajesh Jha 4
fmwhatsapp (https://gbapp.site/fmwhatsapp) Try it now...With latest features
Muhammad Amin 8Muhammad Amin 8
Thanks for the info, download Latest GB Mods apps 100% free safe apps: Click Here (https://installingwhatsapp.com/whatsapp-gb-download-for-android/)
Barba SanaraBarba Sanara
Thanks so much for your informative article. I like your work. Check my tool called Name Combiner on Name Combiner (https://www.mygirlynames.com/combine-names) to find unique names for babies. I must sure you will enjoy it.
tij toktij tok
TikTok Downloader (https://tiktokdownvideo.com/)
tejas mawaletejas mawale
want to download hago game apk (https://podcastfresh.com/hago-game-app-download/) for free. play and earn unlimited money and also get engaged yourself with the new world full of intersting people. really a good app for people those who want to get their time spend.
Jainy SiprJainy Sipr
I wanted to learn the basics of Badminton sports. After researching & reviewing a lot I found best badminton players guide (https://dearbadminton.com/badminton-rules/). It is well recommended for all. 
Regards,