title: How can i refresh the page automatically after performing delete operation
body: <p>I have a view in which i'm performing delete operation. After performing delete opertation, there is no change in page it is still there when i refresh the page manually then i came to know that record has been deleted. Everytime i'm deleting i need to refresh the page manually.
  How can i made it possible to refresh automatically after delete operation.
  A the last i have performed delete functionality.</p>
  <p>Here is my ejs file and ajax call</p>
  <pre><code>&lt;script&gt;
   $(document).ready(function() { 
      $('#expenseId').hide();
      let expenseId =document.getElementById('expenseId').innerHTML;
  
     // alert(expenseId);
     
      let columns ={
          sequence : 'Sequence',
          deleteAction: 'Action',
          name: 'Conveyance Voucher ',
          TravellingPurpose : 'Purpose of Travelling',
          modeOfTravel : 'Nature Of Travel',
          createDdate : 'Created Date',
  
      }
      
    var table = $('#ConveyanceVoucherTable').tableSortable({
      data :[],
      columns,
      searchField: '#searchField',
      sorting: true,
      rowsPerPage: 15,
      pagination:true,
      tableWillMount: () =&gt; {
          console.log('table will mount')
          
      },
      tableDidMount: () =&gt; {
          console.log('table did mount');
  
          $('#spinner').hide();
      },
      tableWillUpdate: () =&gt; {
          console.log('table will update')
      //  table.refresh();
      // onLoadTask();
      },
      tableDidUpdate: () =&gt; {
      console.log('table did update');
       anchorClickFunctionalities();
       additionaldeleteFunctionality();
      
      },
      tableWillUnmount: () =&gt; console.log('table will unmount'),
      tableDidUnmount: () =&gt; console.log('table did unmount'),
      onPaginationChange: function(nextPage, setPage) {
          setPage(nextPage);
      },
       
    });
  
  
    $('#changeRows').on('change', function() {
      table.updateRowsPerPage(parseInt($(this).val(), 15));
      })
  
      $('#refresh').click(function() {
          table.refresh(true);
          onLoadTask();
      })
  
  
      $.ajax({
          url:'/expense/getconveyancelist',
          type:&quot;get&quot;,
          data:
          {
              expenseId:expenseId
          },
          datatype:'json'
      })
      .done((response)=&gt;{
          console.log('response '+JSON.stringify(response));
          table.setData(response, columns);
          anchorClickFunctionalities();
  
       })
       .fail((jqXHR,status,error)=&gt;{
           console.log('jqXHR: '+jqXHR);
           console.log('error: '+JSON.stringify(jqXHR));
  
       })
       function anchorClickFunctionalities(){
          $('a.conveyanceTag').on('click',function(event){
              event.stopImmediatePropagation();
              event.stopPropagation();
              let conveyanceId = this.id;
            //  alert('conveyanceId  '+conveyanceId);
              $('#conveyanceModal').modal('show');
  
              $.ajax({
                  url : '/expense/getConveyanceVoucherDetail',
                  type:'get',
                  data : {
                      conveyanceId : conveyanceId
                  },
                  dataType: 'json',
                  beforeSend : function(){
                    $('#detailLoadingSpinner').show();
                  }
              })
                  .done((response)=&gt;{
                      console.log('ConveyanceVoucherDetail '+JSON.stringify(response));
                    $('#detailLoadingSpinner').hide();
                    if(response.length &gt; 0)
                          {
                            let conveyanceRecord = response[0];
                            let htmlTable = '';
                          //  let strCreatedDate = new 
     Date(conveyanceRecord.createddate).toLocaleString();
                            let strCreatedDate = new Date(conveyanceRecord.createddate);
                            strCreatedDate.setHours(strCreatedDate.getHours() + 5);
                            strCreatedDate.setMinutes(strCreatedDate.getMinutes() + 30);
                            let strDate = strCreatedDate.toLocaleString();
                            htmlTable += '&lt;tr&gt;';
                                htmlTable += '&lt;td&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;';
                                htmlTable += '&lt;td&gt;'+conveyanceRecord.conveyancename+'&lt;/td&gt;';
                                htmlTable += '&lt;td&gt;&lt;strong&gt;Expense Name&lt;/strong&gt;&lt;/td&gt;';
                                htmlTable += '&lt;td&gt;'+conveyanceRecord.expname+'&lt;/td&gt;';
                            htmlTable += '&lt;/tr&gt;';
                            htmlTable += '&lt;tr&gt;';
                              htmlTable += '&lt;td&gt;&lt;strong&gt;From&lt;/strong&gt;&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;'+conveyanceRecord.from__c.slice(0, 10)+'&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;&lt;strong&gt;To&lt;/strong&gt;&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;'+conveyanceRecord.to__c.slice(0, 10)+'&lt;/td&gt;';
                            htmlTable += '&lt;/tr&gt;';
                            htmlTable += '&lt;tr&gt;';
                              htmlTable += '&lt;td&gt;&lt;strong&gt;Amount&lt;/strong&gt;&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;'+conveyanceRecord.amount__c+'&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;&lt;strong&gt;Mode of Conveyance&lt;/strong&gt;&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;'+conveyanceRecord.mode_of_conveyance__c+'&lt;/td&gt;';
                            htmlTable += '&lt;/tr&gt;';
                            htmlTable += '&lt;tr&gt;';  
                            htmlTable += '&lt;td&gt;&lt;strong&gt;Activity Code&lt;/strong&gt;&lt;/td&gt;';
                            if(conveyanceRecord.activitycode != null)
                                htmlTable += '&lt;td&gt;'+conveyanceRecord.activitycode+'&lt;/td&gt;';
                                else
                                htmlTable += '&lt;td&gt;&lt;/td&gt;';
                                htmlTable += '&lt;td&gt;&lt;strong&gt;KM. TRAVELLED&lt;/strong&gt;&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;'+conveyanceRecord.kms_travelled__c+'&lt;/td&gt;';
  
                            htmlTable += '&lt;/tr&gt;';
                            htmlTable += '&lt;tr&gt;';
                              htmlTable += '&lt;td&gt;&lt;strong&gt;Purpose of Travel&lt;/strong&gt;&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;'+conveyanceRecord.purpose_of_travel__c+'&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;&lt;strong&gt;Create Date&lt;/strong&gt;&lt;/td&gt;';
                              htmlTable += '&lt;td&gt;'+strDate+'&lt;/td&gt;';
                            htmlTable += '&lt;/tr&gt;';
                             htmlTable += '&lt;tr&gt;';
                            htmlTable += '&lt;td&gt;&lt;strong&gt;View Image&lt;/strong&gt;&lt;/td&gt;';
                            console.log('conveyanceRecord.heroku_image_url__c) 
      '+conveyanceRecord.heroku_image_url__c);
                            if(conveyanceRecord.heroku_image_url__c != null &amp;&amp; 
       conveyanceRecord.heroku_image_url__c != '' &amp;&amp; conveyanceRecord.heroku_image_url__c != 'demo')
                                htmlTable += '&lt;td&gt;&lt;a target=&quot;_blank&quot; 
       href=&quot;'+conveyanceRecord.heroku_image_url__c+'&quot; &gt;Click Here&lt;/a&gt;&lt;/td&gt;';
                            else
                                htmlTable += '&lt;td&gt;&lt;/td&gt;';
                            
                                htmlTable += '&lt;td&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/td&gt;';
                                htmlTable += '&lt;td&gt;&lt;/td&gt;';
                            htmlTable += '&lt;/tr&gt;';
                            $('#conveyanceVouchertable').empty();
                            $('#conveyanceVouchertable').html(htmlTable);
      
  
                          }
  
  
                  })
                  .fail((jqXHR, status, error) =&gt;{
                      $('#detailLoadingSpinner').show();
                      console.log('jqXHR  : '+JSON.stringify(jqXHR));
                      console.log('error  : '+error);
                    })
              })
      }
     })
  
     function additionaldeleteFunctionality(){
  
      $('.deleteButton').on('click',function(event){
  
    event.preventDefault();
    event.stopPropagation();
    event.stopImmediatePropagation();
    //  $('#parentId').hide();
    // let parentId = document.getElementById('parentId').innerHTML;
      let parentId = this.id;
    console.log('pettyCashId  '+parentId);
    alert('Are you sure to  Delete this record !');
  
      $.ajax({
      url : '/expense/deleteConveyance/'+parentId,
     type:'get',
  
    dataType: 'json',
  
    })
    .done((response) =&gt; {
        console.log('resonse   :'+response);
        alert(&quot;Conveyance Voucher Deleted Succesfullly !&quot;);
    })
    .fail((jqXHR, status, error) =&gt; {
        console.log('jqXHR  '+JSON.stringify(jqXHR));
  }) 
  })
  }
  </code></pre>