使用PullToRefresh插件

时间:2012-10-19 04:46:27

标签: javascript cordova sencha-touch-2

我开始使用Sencha Touch 2并需要集成https://github.com/j-mcnally/Sencha2-PullToRefresh

我刚刚开始使用Sencha,并且无法在文档中找到放入和引用此类扩展的位置。这样做的文件结构和参考代码是什么?它只是去任何地方我在app.js中引用它吗?

将plugins文件夹复制到我的项目中,并将js文件包含在index.html

 

但显示错误  undefined不是一个函数 无法加载RefreshableList.js

2 个答案:

答案 0 :(得分:0)

您可以在Sencha Touch 2的示例文件夹中找到很好的示例。

YOUR_SENCHA_TOUCH_FOLDER / examples / touchtweets / app / view / TweetList.js

中有Pull To Refresh plugin的好例子

Twitter.view.TweetList扩展了一个列表,并在其配置中包含以下代码:

...
plugins: [
    'pullrefresh',
    {
        type: 'listpaging',
        autoPaging: true
    }
],
...

此外,你需要像这样要求相关文件:

requires: [
    'Ext.plugin.PullRefresh',
],

希望这有帮助

答案 1 :(得分:0)

Sencha Touch 2提供了一个pull to refresh插件,也许你可以使用那个插件? Sencha提供的pull to refresh插件的文档位于http://docs.sencha.com/touch/2-0/#!/api/Ext.plugin.PullRefresh

相关问题