Created
October 12, 2020 18:29
-
-
Save Azsaturndx/17111684463b64cf06f1fd0e290b8cd0 to your computer and use it in GitHub Desktop.
Refresh a Grid periodically - Code onTime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Reloads a dataView every periodically | |
* (Code onTime) | |
* AzsaturnDx (2020) - No copyright at all | |
* | |
* Reload data from the contextDataview | |
* | |
* Implementation: | |
* 1.- Copy this to a file. | |
* 2.- Copy this file to (...)/app/js/ | |
*/ | |
//Refresh time in seconds | |
var refreshInterval = 30; | |
refreshGrid(); | |
function refreshGrid() { | |
setTimeout(function () { | |
//Use this if you know the controller's name | |
Web.DataView.find('Contratado_Admin').refresh(); | |
//Or this, if you just want to reload data from current view: | |
//$app.touch.contextDataView().refresh(); | |
refreshGrid(); | |
}, | |
refreshInterval * 1000 | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment