Forum Discussion

PaulTrimor's avatar
PaulTrimor
Qrew Cadet
8 years ago

Is there an existing javascript function to redraw a table?

I would like to delete records and have the table refresh asychonously. 

Right now, I have a table with each row containing a delete button. I can use javascript to make an API call that will delete the record the button is associated to. However, is there a Quickbase javascript function I could call to "redraw" or "refresh" the current table instead of refreshing the page. 

This is mostly for better user experience.  
  • What is the source of the data you want to import?  Is it from another table?  if so, then you can use API_RunImport.
    • PaulTrimor's avatar
      PaulTrimor
      Qrew Cadet
      i don't want to import anything, its a just a delete button. 
  • For the most part QuickBase is designed to reload pages to display new data and not as a single page application which refreshes data through background AJAX calls. However, there are libraries and techniques that are widely available that would allow you to create the feature your describe but you would have to write and splice the relevant code into the QuickBase page yourself using an injection technique.
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      Paul, is this syntax what you are looking for?  It does the URL and then refreshes the record or report you are on.

      var text URL= URLRoot() & "db/" & [_DBID_TABLE_1] & "?act=API_EditRecord"
      & "&rid=" & URLEncode ([Record ID#])
      & "&_fid_7=" & URLEncode ([Status])
      & "&apptoken=" & "XXXX";


      "javascript:" &
      "$.get('" & 
      $URL & 
      "',function(){" &
      "location.reload(true);" &
      "});" 
      & "void(0);