The PullToRefresh widget implements the TableView Refresh with headerPullView for Titanium Alloy by Appcelerator.
- Initialize the widget through one simple call.
- Change (localize) any of the messages displayed.
- Localized date and time of last update.
- Direct localization calls from within the widget.
- Callback to check if the widget is allowed to do reload.
- Download the repository of the widget as a ZIP file.
- Move the file to your project's root folder.
- Unzip the file and you'll find the widget under
app/widgets/nl.fokkezb.pullToRefresh. - Add the widget as a dependency to your
app/config.jsonfile like so:
…
"dependencies": {
"nl.fokkezb.pullToRefresh":"1.0"
}- Attach the widget to any Ti.UI.TableView like so:
var ptrCtrl = Alloy.createWidget('nl.fokkezb.pullToRefresh', null, {
table: $.myTable,
load: myLoadCallback
});- In your myLoadCallback notify the widget when you're done loading:
…
ptrCtrl.reset();The only required parameters are the table and load parameters. You can change the displayed texts using the following additional ones:
| Parameter | Type | Default |
|---|---|---|
| msgPull | string | Pull down to refresh... |
| msgRelease | string | Release to refresh... |
| msgUpdating | string | Updating... |
| msgUpdated | string | Last Updated: %s %s |