hanzouti
hanzouti

Reputation: 48

Sencha touch 2 load elements when scroll down

I'm developing a android and iOS app using Sencha Touch 2. I have a scrollable view with a lot of images, one embeded youtube video. And I cause me issue in terms of performance.

I'm searching a solution of lazy load this elements if they are not on the viewport to load them on demand when the user scroll down.

Thanks,

Upvotes: 0

Views: 556

Answers (1)

Nathan Do
Nathan Do

Reputation: 2035

As of sencha touch 2.1, there is an option for infinite list.
They will only render item as needed (with some buffer to make the scroll smooth)

All you need to do is specify 'infinite:true'

{
    xtype: 'list',
    infinite: true
}                

If your list have a lot of images, you should try this code:
https://github.com/nathando/st-lazyload-list.

Upvotes: 1

Related Questions