Refetches the contents of the dataset from the collection.
The refresh()
function returns a Promise that is resolved
when:
Refreshing the dataset sets the current item back to the first item in the dataset regardless of what the current item was before refreshing.
Note:
A dataset needs to load its data before you call its refresh()
function.
Usually a dataset finishes loading a short time after the page it is on finishes
loading. So if you call refresh()
inside the page’s onReady()
event handler, the dataset might not be ready yet.
To call refresh()
as soon as possible after a page loads, use the dataset's
onReady()
function inside the page’s onReady()
event handler to ensure that both the page and the dataset have finished loading.