Is there an existing javascript function to redraw a table?

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
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.  
Photo of Paul Trimor

Paul Trimor

  • 488 Points 250 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,266 Points 50k badge 2x thumb
What is the source of the data you want to import?  Is it from another table?  if so, then you can use API_RunImport.
Photo of Paul Trimor

Paul Trimor

  • 488 Points 250 badge 2x thumb
i don't want to import anything, its a just a delete button. 
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,372 Points 20k badge 2x thumb
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.
Photo of Paul Trimor

Paul Trimor

  • 488 Points 250 badge 2x thumb
Thanks you. 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,256 Points 50k badge 2x thumb
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);"