Sencha-PullRefresh-RefreshFn
Sencha-PullRefresh-RefreshFn copied to clipboard
Sencha removed the refreshFn from the pullrefresh plugin in ST 2.2. Here is an user extension with gives the old functionality back to you.
Sencha-PullRefresh-RefreshFn
About:
Sencha removed the refreshFn from the pullrefresh plugin in ST 2.2.
Here is an user extension with gives the old functionality back to you.
Discussion
version 1.0.0
based on Sencha Touch 2.2.0
written by Martin Hess
tested against:
- Sencha Touch 2.2.0
- Sencha Touch 2.2.1
version 2.0.0
based on Sencha Touch 2.3.0
written by Martin Hess
tested against:
- Sencha Touch 2.3.0
- Sencha Touch 2.3.1
- sometimes a bug ca ocure that the list isn't snapping back (if anyone findes the bug, I would appreciate it if I get sent the solution)
version 2.0.1-beta
based on Sencha Touch 2.3.0
written by Martin Hess
tested against:
- Sencha Touch 2.3.0
- Sencha Touch 2.3.1
- i implemented a little hack for the animation, its working so far but its still not nice
Usage:
-
copy the PullRefreshFn.js to "./ux/touch/"
-
add ",${app.dir}/ux/touch" to "./.sencha/app/sencha/cfg" to variable "app.classpath" (builder needs to know where the plugin is located)
app.classpath=${app.dir}/app.js,${app.dir}/app,${app.dir}/ux/touch
- load your the file in your "./app.js"
Ext.Loader.setPath({
'Ext': 'touch/src',
'Ext.ux.touch': 'ux/touch',
...
});
- create a List like this (it's the sencha touch 2.1.1 way)
Ext.create('Ext.dataview.List', {
fullscreen: true,
store: store,
plugins: [
{
xclass: 'Ext.ux.touch.PullRefreshFn',
pullRefreshText: 'Pull down for more new Tweets!'
refreshFn: function() {
Ext.getStore('ENTER YOUR STORE HERE').load()
}
}
],
itemTpl: [
'YOUR ITEMTPL'
]
});
- Enjoy!
Greetings,
Martin Hess