Skip to content
🚀 Rapid Application Development with the App Builder

Auto-reload at specific intervals

This example demonstrates how to use the onAppClose and customActionsTop hooks to automatically reload a table every 5 seconds. To avoid unnecessary rerenders, the global variable window._requeryTimer is utilized.

✨ Example customActionsTop Hook

js
((table) => {

    function refreshTable() {
        if (window._requeryTimer !== undefined) {
            table.requery()
            setTimeout(refreshTable, 5000)
        }
    }
    
    if (window._requeryTimer === undefined) {
        window._requeryTimer = true
        setTimeout(refreshTable, 5000)
    }
  
    return null

})

✨ Example onAppClose Hook

js
(() => {
    
    delete window._requeryTimer
  
})