0

I have created a custom lightning page and it looks like the below screenshot.

enter image description here

But I want to place the delete button exactly before the cancel button

Can someone please suggest to achieve the same?

below is the code for the same

<aura:component controller="OverRideDeleteButton" implements="force:lightningQuickAction, force:hasRecordId" >
    <lightning:card >
        <p>Are you sure you want to delete this record</p>

        <div class="slds-docked-form-footer">
            <lightning:button variant="destructive" label="Delete" onclick="{!c.deleteRecord}"/>
        </div>
    </lightning:card>
</aura:component>
  • were you able to make it work? – glls Feb 11 at 18:55
  • Nope, I am still trying to – gs650x Feb 12 at 5:40
2

You can split your card into sections using aura:set's as specified in the documentation (ex, ehader, body, footer), you might want to refactor your code to something similar to what is provided in the documentation:

 <lightning:card>
    <aura:set attribute="title">
        <lightning:icon iconName="utility:connected_apps" size="small"/>
        {! v.title }
    </aura:set>
    <aura:set attribute="footer">
        <lightning:badge label="Tag1"/>
        <lightning:badge label="Tag2"/>
        <lightning:badge label="Tag3"/>
    </aura:set>
    Card Body (custom component)
</lightning:card>
  • Thank you for responding, but the above code creates another footer top of the cancel button but I want to add a button right before the cancel button – gs650x Feb 12 at 5:39
  • that is why i mentioend that you need to refactor your code to adopt the aforementioned structure, replace your footer with the ootb one from the lightning:card component – glls Feb 12 at 14:07
  • I have implemented "force:lightningQuickAction" and added the above component as a custom button now I nowhere define the cancel button but still, it is there and if I use the above code provided by you it creates another footer instead of adding the button to the standard footer – gs650x Feb 13 at 5:14

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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