Nativescript RadListView implement infinity scrolling - just triggered once

2 posts, 0 answers
  1. Frank
    Frank avatar
    2 posts
    Member since:
    Jul 2017

    Posted 30 Sep Link to this post

    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
  2. Frank
    Frank avatar
    2 posts
    Member since:
    Jul 2017

    Posted 30 Sep in reply to Frank Link to this post

    figured out, 

    Having to call this method after setting the new array:

     

    listView.notifyLoadOnDemandFinished();

Back to Top