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

Calling refresh method does not cause a new request, but clears listview

0 Answers 89 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Sasha
Top achievements
Rank 1
Sasha asked on 01 May 2012, 06:05 AM
I am testing in Chrome. I don't see any errors in the developer's console. I also don't see a 2nd request made to the datasource.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <title>My Open Cal</title>
 
    <!-- Kendo UI Files -->
    <link href="styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/kendo.mobile.min.js" type="text/javascript"></script>
    <script>
        $( //jQuery page load
            function ()
            {
                var app = new kendo.mobile.Application($(document.body), { layout: "layout", icon: "/images/xboxavatar.png" });
                $("#ulMyCal").kendoMobileListView({
                     
                    dataSource: new kendo.data.DataSource(
                    {
 
                        transport:
                                {
                                    read:
                                    {
                                        url: "http://search.twitter.com/search.json",
                                        contentType: "application/json; charset=utf-8",
                                        type: "GET",
                                        dataType: "jsonp",
                                        data:
                                        {
                                            q: "#tampa"
                                        }
                                    }
                                },
 
                        schema: {
                            data: "results"
 
                        }
                    }),
                    template: "<p>${text}</p>"
 
                });
 
                setTimeout(refreshListView, 5000);
 
 
            })
 
            function refreshListView()
            {
                $("#ulMyCal").data("kendoMobileListView").refresh();
            }
    </script>
</head>
<body>
 
    <!-- Layout for all views in the application, as specified when the app is created -->
    <div data-role="layout" data-id="layout">
      <div data-role="header" >
          <div data-role="navbar">
            <span data-role="view-title">My Open Cal</span>
          </div>
      </div>
      <div data-role="footer">
          <div data-role="tabstrip">
            <a href="#index" data-icon="organize">My Calendar</a>
            <a href="#search" data-icon="search">Search</a>
            <a href="settings.htm" data-icon="settings">Settings</a>
          </div>
     </div>
    </div>
 
 
    <div data-role="view" id="index" data-title = "My Calendar">
        <div style="text-align:center">
            <ul id="ulMyCal" data-style="inset">
             
            </ul>
        </div>
    </div>
 
    <div data-role="view" id = "search" data-title = "Search">
         
    </div>
 
</body>
</html>

No answers yet. Maybe you can help?

Tags
ListView (Mobile)
Asked by
Sasha
Top achievements
Rank 1
Share this question
or