5

I am actually creating a component that will implement the force:lightningQuickAction so that my component open in a modal window from the action button.I would like to capture the event where the user cliked on the save button, but there is no place that explain how to do it.

I found from the official doc that i can, from my component call the close method of the modal. But i want to access the save action.

I think that it is not an impossible thing to do, as salesforce already implemented the lightning event, used to communicate between components without sharing variable parameters between them.

So isn't there something like registering to a certain event from my parent modal and executing an action when the event fire or something similar to achieve this?

0

Try this. After few css trick, I managed to fix it myself. This solution override the dialog box height which you mentioned while creating custom action on an object. I hope this will help someone needed.

<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" controller="MilindTest">     
<style>
    .cuf-content {
    padding: 0 0rem !important;
    }
    .slds-p-around--medium {
    padding: 0rem !important;
    }
    .slds-modal__content {
    overflow-y: hidden !important;
    height: unset !important;
    max-height: unset !important;
    }        
</style>

<div class="slds-col modal-header slds-modal__header">
    <h2 class="title slds-text-heading--medium">Milind Test</h2>
</div>
<div class="slds-col modal-body scrollable slds-p-around--medium" style="height: 200px; max-height: 400px; overflow-y: auto !important">
    <div>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
    </div>
</div>
<div class="slds-col modal-footer slds-modal__footer">        
    <lightning:button variant="neutral" label="Cancel" onclick="{! c.cancelClick }" />      
    <lightning:button variant="brand" label="Save" onclick="{! c.saveClick }" />
</div>

| improve this answer | |
  • 5
    Not good to add CSS like this. One should use the style component to add CSS. – itzmukeshy7 Jan 6 '18 at 5:48
  • 2
    I think the last release disallows style tags in the component body. Better to implement a headless global action and add your own save button. – Caspar Harmer Mar 14 '18 at 21:35
0

As mentioned by @CasparHarmer's comment - try implementing the force:lightningQuickActionWithoutHeader interface in the component's implements attribute and create the save button yourself

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.