1

ust started using Sencha Touch 2 and need to integrate https://github.com/j-mcnally/Sencha2-PullToRefresh

I've just started using Sencha, and wasn't able to find in the documentation where to drop in and reference such extensions. What's the file structure and reference code necessary to do so? Does it just go anywhere and I reference it in app.js?

copy the plugins folder to my project and include the js file in index.html

but showing error undefined is not a function failed to load the RefreshableList.js

Titouan de Bailleul
  • 12,920
  • 11
  • 66
  • 121
veena
  • 39
  • 3

2 Answers2

0

You can find good examples in the examples folder of Sencha Touch 2.

There is a good example of the Pull To Refresh plugin in YOUR_SENCHA_TOUCH_FOLDER/examples/touchtweets/app/view/TweetList.js

Twitter.view.TweetList extends a list and has the following code in its config :

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

Also you need to require the relevant file like so :

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

Hope this helps

Titouan de Bailleul
  • 12,920
  • 11
  • 66
  • 121
  • ,Here am parsing the json and displaying only 100 items at a time so after listing 100 items and when the user scroll and reach 100th item , I want to again parse json .In pullrefresh plugin only while scrolling up refreshFn will call but i want to parse json while scrolling down . – veena Oct 23 '12 at 04:45
  • Then you need the ListPaging plugin : http://docs.sencha.com/touch/2-0/#!/api/Ext.plugin.ListPaging – Titouan de Bailleul Oct 23 '12 at 09:27
0

Sencha Touch 2 provides a pull to refresh plugin, maybe you could use that one? The documentation on the pull to refresh plugin provided by Sencha is at http://docs.sencha.com/touch/2-0/#!/api/Ext.plugin.PullRefresh

  • ,Here am parsing the json and displaying only 100 items at a time so after listing 100 items and when the user scroll and reach 100th item , I want to again parse json .In pullrefresh plugin only while scrolling up refreshFn will call but i want to parse json while scrolling down . – veena Oct 23 '12 at 04:45
  • wouldn't know how to do that, but maybe you could add a listitem to the end of your list containing a button to 'load more items'? I've seen this approach in several apps. – Joost van Hassel Oct 23 '12 at 07:46