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

best way to implement endless scroll that ends with last item in datasource

1 Answer 112 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 24 Jul 2012, 03:49 PM
I have a datasource which could have any number of items, therefore the total of items will be unknown.  I would like to have a maximum of 10 items per page and would ideally like to scroll through these items using the endless scroll feature.  However, the endless scroll will continue to loop through the datasource items when the last item has been reached. 

I would like to use the endless scroll feature until the last item has been displayed and then this stops.  I will therefore need to perform a check  and stop returning records after all items have been requested.  The problem is, I have no idea where to start with implementing this.  I am using PHP.  Can anyone advise?

var DataSource = new kendo.data.DataSource({
     pageSize: 10,
      transport: {
          read: "data.php",
          dataType: "json",
    }
     sort: { field: "created", dir: "desc" },                                        
            
     });

  $("#list").kendoMobileListView({
              dataSource: DataSource,
              pullToRefresh: true,
              appendOnRefresh: false,    
              endlessScroll: true,
              scrollTreshold: 30, //treshold in pixels                            
              style: "inset",       
              template: $("#list").text()
          });

I assume I need to use the serverPaging and page  attributes that are in the documentation but this does not give any examples that help.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 27 Jul 2012, 01:04 PM
Hello Martin,

 
Here is a quote of the answer, which I posted in the support thread opened on the same matter:

Here is a simple test project (ASP.NET) which shows how the case is handled on the server. You can also check this thread, which provides other possible solution. Nevertheless we will try to provide a better handling of the "endless scrolling" scenario for the service pack of the KendoUI (scheduled for the mid of August). 

I will suggest you also to continue our conversation in the support thread in order to avoid any duplications. 

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView (Mobile)
Asked by
Martin
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or