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
Vanitha ManiVanitha Mani 

how to refresh table

Hi i have a table displays the recentlr created record..i need to refresh the table..how to achieve it?
Component:

<aura:if isTrue="{!v.ticket.Total_Work_Time__c == 0}">
                    <div>
                        <div role="dialog" aura:id="Modalbox" class="slds-modal slds-fade-in-open ">
               <div class="slds-modal__container">
                  
                    
                            
                   <div class="slds-m-around--xx-large">
                       
        <lightning:card title="Work Time" iconName="custom:custom86" class="slds-p-around_medium">
            <br/>
            <div class="slds-m-around_xx-small">
        <div class="slds-align--absolute-left">
        <h1 class="slds-text-heading--small">No Existing Work Time Entries Found. Please add below:</h1>
        </div>
            </div>
            <br/>
            <lightning:recordEditForm aura:id="leadCreateForm2"  objectApiName="SVC_Work_Time__c">
                <lightning:messages />

                <lightning:inputField aura:id="lookup" fieldName="Ticket__c" value="{!v.recordId}"></lightning:inputField>
                   
                    
                        <lightning:inputField fieldName="Work_Date__c"></lightning:inputField>
                    
               
                        <lightning:inputField fieldName="User__c"></lightning:inputField>
                    
               
                        <lightning:inputField fieldName="Minutes__c"></lightning:inputField>
                    
                  
                        <lightning:inputField fieldName="After_Hours__c"></lightning:inputField>
                    
                          
                        <lightning:inputField fieldName="Reason__c"></lightning:inputField>
                    
               
                <br/><br/><br/>
                <center>
                 
                <lightning:button type="submit" label="Save" variant="brand" onclick="{!c.handleOnSubmit}"/>
                  
                    <lightning:button  label="Save and New"  variant="brand"/>
                  
                <lightning:button  label="Close" onclick="{!c.closemodal}" variant="brand"/>
                   
                </center>
            </lightning:recordEditForm>
        </lightning:card>
    </div>
                </div>
            </div>
            <div class="slds-backdrop slds-backdrop--open" aura:id="Modalbackdrop"> 
             </div>
         
                    
                  </div>
        <aura:set attribute="else">    
    <div class="slds-m-around_xx-small">
        <div class="slds-align--absolute-left">
        <h1 class="slds-text-heading--small">Below are the 5 most recent work time entries</h1>
            <br/>
        </div>
                </div>
                             
                            <table class="slds-table slds-table_bordered slds-table_cell-buffer">
        <thead>
            <tr class="slds-text-title--caps">
                
                <th scope="col"><div class="slds-truncate" title="Id">S.No</div></th>
               
                <th scope="col"><div class="slds-truncate" title="Work Date">Work Date</div></th>
                <th scope="col"><div class="slds-truncate" title="User">User</div></th>
                <th scope="col"><div class="slds-truncate" title="Minutes">Minutes</div></th>
                <th scope="col"><div class="slds-truncate" title="After Hours">After Hours</div></th>
                <th scope="col"><div class="slds-truncate" title="Reason">Reason</div></th>
                
                
            </tr>
        </thead>          
        <tbody>
    
               <aura:iteration items="{!v.timeList}" var="time" indexVar="sNo"  >
              
                       
             
                   <c:Inlinechildtime single="{!time}"  sNo="{!sNo + 1}"/>
                   
            </aura:iteration>
            </tbody>
            </table>
                            <br/>
                            <br/>
                            <center>
                            <div class="slds-m-around_xx-small">
        <div class="slds-align--absolute-Center">
        <h1 class="slds-text-heading--small">Do you need to add any additional work time?</h1>
            <br/>
            <br>
            </br>
            <br>
            </br>
        </div>
                </div>
                            
                    <button class="slds-button slds-button_success" type ="submit" onclick="{!c.actionhandler2}"  >Yes</button>
                                

                            <button class="slds-button slds-button_destructive" onclick="{!c.handleNext1}">No</button>
                                <br/>
                                <br/>
                                <br/>
                                <br/><br/>
                                <br/>
                                <br/><br/><br/><br/>
                           
            <aura:if isTrue="{!v.seeu}">
 <div role="dialog" aura:id="Modalbox" class="slds-modal slds-fade-in-open ">
               <div class="slds-modal__container">
                   
                   <div class="slds-m-around--xx-large">
                       
        <lightning:card title="Work Time" iconName="custom:custom86" class="slds-p-around_medium">
            <br/>
            <lightning:recordEditForm aura:id="leadCreateForm2"  objectApiName="SVC_Work_Time__c">
                <lightning:messages />
                 
                <lightning:inputField fieldName="Ticket__c" value="{!v.recordId}"></lightning:inputField>
                        <lightning:inputField aura:id="lookup" fieldName="Work_Date__c"></lightning:inputField>
                   
                   
                        <lightning:inputField aura:id="lookup" fieldName="User__c"></lightning:inputField>
               
               
                        <lightning:inputField aura:id="lookup" fieldName="Minutes__c"></lightning:inputField>
                  
                   
                        <lightning:inputField aura:id="lookup" fieldName="After_Hours__c"></lightning:inputField>
                
                          
                        <lightning:inputField aura:id="lookup" fieldName="Reason__c"></lightning:inputField>
                  <br/><br/><br/>
                <center>
                 
                <lightning:button type="submit" label="Save" variant="brand" onclick="{!c.handleOnSubmit}"/>
                    <lightning:button type="submit" label="Save and New"  variant="brand" onclick="{!c.handleOnSubmit2}"/> 
                <lightning:button  label="Close" onclick="{!c.closemodal}" variant="brand"/>
                </center>
            </lightning:recordEditForm>
        </lightning:card>
    </div>
                </div>
            </div>
            <div class="slds-backdrop slds-backdrop--open" aura:id="Modalbackdrop"> 
             </div>
         
          </aura:if>     


Controller:
var action = component.get("c.fetchtime");
       var recordId = component.get("v.recordId");
        
        action.setParams({
           recordId : recordId
            
            
            
                   });
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var storeResponse = response.getReturnValue();                
                component.set("v.timeList", storeResponse);
                $A.get('e.force:refreshView').fire();
            }
        });
        $A.enqueueAction(action);
         $A.get('e.force:refreshView').fire();  
       },
I tried $A.get('e.force:refreshView').fire(); but it didnt refresh
AnudeepAnudeep (Salesforce Developers) 
Hi Vanitha, 

I suggest placing the html table inside an outputpanel and rerendering the panel. I also recommend checking this post where a similar issue is discussed

Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you