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

LoadMore button disappear, no data populated

3 Answers 76 Views
ScrollView (Mobile)
This is a migrated thread and some comments may be shown as answers.
CH
Top achievements
Rank 1
CH asked on 01 Feb 2013, 02:29 AM
Hi,
I am using KendoUI version: 2012.3.1315.commercial.
I need help to understand the below code:
i use TabStrip and in my second Tab, i uses ListView to load my data. In the listView, i wanted to call the record as pagination.

I have encounter a very funny behaviour with my code. The LoadMore button when press\click, it just disappear, no event fired to fetch my next record.  

Thanks for the advise.

Following are my code:

HTML:
<div data-role="view" data-title="Views" id="overview-list" data-init="ProjectList" data-layout="overview-layout" >
 
 
  <ul data-role="listview" data-style="inset" data-type="group"  >
        <li>
            <ul id="endless-scrolling" >
       
            </ul>
           
           
        </li>
    </ul>
 
   
 <script id="endless-scrolling-template" type="text/x-kendo-template">
   <a href="/_layouts/projectDetail.aspx?id=#=ID #" data-transition="slide"">
                     <div class="Lists">
                            <img class="pullImage" src="#=Picture1 #" />#= Title #
                             <div class="metadata">
                              #= Description #
                             </div>
                        </div>
                        </a>
    
</script>
</div>

and my Javascript:
$(function () {
       window.kendoMobileApplication = new kendo.mobile.Application(document.body);
 
   });
   var Skip = 0; //Number of skipped row
   var Take = 1; //
   
   function ProjectList() {
       var dataSource = new kendo.data.DataSource({
           transport: {
               read: function (options) {
                   // make AJAX request to the remote service
                   $.ajax({
                       type: "POST",
                       url: "mobile.aspx/AllProject",
                       data: "{ Skip:" + Skip + ", Take:" + Take + " }",
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       headers: { "cache-control": "no-cache" },
                       success: function (data) {
                           Skip = Skip + Take;
                           options.success(data.d);
                       }
                   });
               },
               cache: false
 
           },
           schema: {
               total: function () { return 0; }
 
           }
       });
 
      var listMore  =$("#endless-scrolling").kendoMobileListView({
           dataSource: dataSource,
           template: $("#endless-scrolling-template").text(),
            loadMore: true
     
       });
 
       
    }


3 Answers, 1 is accepted

Sort by
0
CH
Top achievements
Rank 1
answered on 01 Feb 2013, 05:01 AM
Hi Administrator,
apology as i posted in the wrong forum, can you change my thread to ViewList instead?

thanks you.

Regards,
CH
0
Alexander Valchev
Telerik team
answered on 04 Feb 2013, 01:53 PM
Hello CH,

Thank you for getting in touch with us. The thread is moved into the appropriate section - ListView for KendoUI Mobile.

Regarding the issue you described, your DataSource does not have a pageSize set. If you want pagination (load more) please define the size of the page (e.g. how many records should be loaded).

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
CH
Top achievements
Rank 1
answered on 05 Feb 2013, 01:38 AM
Hi Alexander,

Thank you for the advice. I notice that last night and manage to change it.

Thanks you again.

Regards,
CH
Tags
ScrollView (Mobile)
Asked by
CH
Top achievements
Rank 1
Answers by
CH
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or