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
Aruna Dhavaleswarapu 4Aruna Dhavaleswarapu 4 

Open a modal container from Quick Action based on condition

When I click the quick action I still see an empty container. Is it possible to hide that 
#Example.cmp
<aura:component implements="force:hasRecordId,force:lightningQuickActionWithoutHeader" access="global" >
    <aura:attribute name="isOpen" type="boolean" default="false" />
    <aura:if isTrue="{!v.isOpen}">
        <div class="slds-col modal-header slds-modal__header">
            <h2 class="title slds-text-heading--medium">Milind Test</h2>
        </div>
        <div class="slds-modal__content slds-p-around--medium" >
            <div>
                
            </div>
        </div>
        <div class="slds-modal__footer">        
            <lightning:button variant="neutral" label="Cancel" onclick="{! c.cancelClick }" />      
            <lightning:button variant="brand" label="Save" onclick="{! c.saveClick }" />
        </div>
    </aura:if>
</aura:component>

User-added image
Raj VakatiRaj Vakati
Yes .. You can do it by using the 
 
$A.util.addClass(elm, 'slds-hide'); 

or 

    $A.util.removeClass(elm, 'slds-hide'); 

Style classes from the controller

 
Raj VakatiRaj Vakati
Some think like below
 
({
    doInit: function (cmp, event, helper) {
        var getId = cmp.get('v.recordId');
        // callback function 
        var onSuccessSuccess = function(bpRequest){
            
            if(onSuccessSuccess === 'Closed'){
                helper.showElement(cmp,'messageContent');
                helper.hideElement(cmp,'showMessage');
                helper.hideElement(cmp, 'saveButton');
             
            }
        }
        // Invoke helper method 
        helper.retrieveBPRequestStatus(cmp, getId, onSuccessSuccess);
    },
     
    doCancel : function(cmp,helper,event){
        var closeAction = $A.get("e.force:closeQuickAction");
        closeAction.fire();
    },
    
})
 
({
    onSuccessSuccess: function (cmp, recId, onSuccessSuccess) {
        var action = cmp.get("c.getAction");
        
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var retVal = response.getReturnValue();
                onSuccessSuccess(retVal);
            } else if(state == "ERROR"){
                console.log('Error');
            }
            
        });
        $A.enqueueAction(action);
    },
    hideElement: function (cmp, elementId) {
        var elm = cmp.find(elementId);
        $A.util.addClass(elm, 'slds-hide');
    },
    showElement: function (cmp, elementId) {
        var elm = cmp.find(elementId);
        $A.util.removeClass(elm, 'slds-hide');
    }
})