This is a migrated thread and some comments may be shown as answers.

Nativescript RadListView implement infinity scrolling - just triggered once

1 Answer 236 Views
ListView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Frank
Top achievements
Rank 1
Frank asked on 30 Sep 2017, 06:14 PM
I need to provide infinity scrolling for the app, I used ListView directly, and the loadMoreItems event worked perfectly. But now, I want to use RadListView, but I noticed that loadMoreDataRequested event just triggered once. This means, when user first got this event, I updated the data items, and UI refreshed, but then user continue to scroll, the loadMoreData event is no longer triggered. Any solution for this?

I used this:

```
<RadListView row="1" [items]="rssItems"
    visibility="{{loading ? 'collapse':'visible'}}"
    (itemTap)="onItemTap($event)"

    loadOnDemandMode="Auto"
    (loadMoreDataRequested)="loadMoreItemsForRadList()"

    >

</RadListview>
```

Then in TS;
```
public loadMoreItemsForRadList(args: ListViewEventData){
            if(this.bSearching){
                var listView: RadListView = args.object;
                this.rssService.nextSearchPageFor(this.rssType, this.selectedBooks,
                    [this.selectedDateOption, this.selectedDate1, this.selectedDate2],
                    items => {
                        this.rssItems = items;

                         listView.notifyLoadOnDemandFinished();
                    });
                }else{
                    this.rssService.nextPageFor(this.rssType, items => {
                        this.rssItems = items;

                         listView.notifyLoadOnDemandFinished();
                    });
                }

        }
```

But the onScrollEnded() method has never been triggered. 

Can anyone suggest the working sample code for RadListView's infinity scrolling solutions?

Thanks

1 Answer, 1 is accepted

Sort by
0
Frank
Top achievements
Rank 1
answered on 30 Sep 2017, 11:27 PM

figured out, 

Having to call this method after setting the new array:

 

listView.notifyLoadOnDemandFinished();

Tags
ListView
Asked by
Frank
Top achievements
Rank 1
Answers by
Frank
Top achievements
Rank 1
Share this question
or