LoadMore button disappear, no data populated

4 posts, 0 answers
  1. CH
    CH avatar
    48 posts
    Member since:
    Aug 2010

    Posted 31 Jan 2013 Link to this post

    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
         
           });
     
           
        }


  2. CH
    CH avatar
    48 posts
    Member since:
    Aug 2010

    Posted 31 Jan 2013 Link to this post

    Hi Administrator,
    apology as i posted in the wrong forum, can you change my thread to ViewList instead?

    thanks you.

    Regards,
    CH
  3. Kendo UI is VS 2017 Ready
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 04 Feb 2013 Link to this post

    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!
  5. CH
    CH avatar
    48 posts
    Member since:
    Aug 2010

    Posted 04 Feb 2013 Link to this post

    Hi Alexander,

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

    Thanks you again.

    Regards,
    CH
Back to Top
Kendo UI is VS 2017 Ready