Skip to main content
In a lightning component I have a button that updates a field show__c on a child record. After the update the button should be invisible. This is only working after I do a page refresh.

How can I refresh the lightning component after the button click?

 

<aura:component controller="SampleController" Implements="flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" >

<aura:attribute name="childitems" type="List" />

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />

<!-- Use a data table from the Lightning Design System: https://www.lightningdesignsystem.com/components/data-tables/ -->

<table class="slds-table slds-table_bordered slds-table_cell-buffer slds-no-row-hover">

<thead>

<tr class="slds-text-heading_label">

<th scope="col"><div class="slds-truncate" title="Button">Button</div></th>

</tr>

</thead>

<tbody>

<aura:iteration items="{!v.childitems}" var="childitem">

<tr>

<td>

<div class="slds-form-element">

<aura:renderIf isTrue="{!childitem.show__c}">

<lightning:button variant="brand" label="Sell" title="{!childitem.Id}" name="{!childitem.Id}" onclick="{!c.updateCheck11}" />

</aura:renderIf>

</div>

</td>

</tr>

</aura:iteration>

</tbody>

</table>

</aura:component>

 
1 answer
0/9000