Issue using pullToRefresh in Desktop site

4 posts, 0 answers
  1. John
    John avatar
    4 posts
    Member since:
    Dec 2014

    Posted 07 Jul 2015 Link to this post

    I have a site where I am mixing mobile and desktop widgets, in some cases I show a mobile widget if viewed on a mobile device.  I am trying to use the mobileListView with the below code.

     

    01.<script id="tmp" type="text/x-kendo-template">
    02. 
    03.    <p>#: name # <span>Age: #: age #</span></p>
    04.</script>
    05.<script>
    06. 
    07. var dataSource = new kendo.data.DataSource({
    08.        data: [
    09.            { name: "Jane Doe", age: 30 },
    10.            { name: "John Doe", age: 33 }
    11.        ]
    12.    });
    13. 
    14.    $("#lv-detail").kendoMobileListView({
    15.        dataSource: dataSource,
    16.        pullToRefresh: true,
    17.        template: kendo.template($("#tmp").html())
    18.    });
    19.</script>

     I get an error stating Cannot read property 'setOptions' of undefined.  I have followed the instructions here on using mobile widgets with desktop:

    http://docs.telerik.com/kendo-ui/mobile/regular-usage

    I have version v2015.2.624 of the components.

     You can see the issue here:

    http://dojo.telerik.com/oQAtO

     

    If you remove the pullToRefresh attribute the list view renders

  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 08 Jul 2015 Link to this post

    Hello John,

    in order to use pull to refresh, you will need a mobile scroller - something like this.

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. John
    John avatar
    4 posts
    Member since:
    Dec 2014

    Posted 10 Jul 2015 in reply to Petyo Link to this post

    Thanks, I'm getting further now.  The behaviour is still not as  I expect.  When I add pullToRefresh and EndlessScrolling with a page size of 5 it doesn't seem to work correctly at all. It only ever shows 2 items.

     see http://dojo.telerik.com/UYiRO

  5. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 12 Jul 2015 Link to this post

    Hi,

    the behavior you refer to is by design and documented here. You should use larger page size. Please look through the linked article, as there are several specifics of the endless scrolling mode. 

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready