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

Remote Views - Not working offline?

1 Answer 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 11 Sep 2013, 10:21 AM
Hi,
My webapp is not being hosted online, it is simply a series of html/css/js files on my machine. 

I am using a splitview with 2 panes, a simplified structure of the left pane can be seen below:

<div data-role="pane" id="left-pane" data-layout="side-default" data-transition="slide">
 
      <div data-role="layout" data-id="side-default" data-show="toggleBackButton">
          <!-- layout stuff here -->
      </div>
 
      <div data-role="view" id="side-view">
          <!-- Left Panel Content -->
          <ul data-role="listview" data-style="inset">
              <li><a href="#testview">Commercial Services</a></li>
              <li><a href="testview.html">Litigation Services</a></li>
              <li><a href="views/paneviews/private_client_services/index.html">Private Client Services</a></li>
          </ul>
          <!--    -->
 
      </div>
 
      <div data-role="view" id="testview">
        <p>Test view</p>
      </div>
    </div>
There are 3 buttons in the UL. The first looks for a view in the current HTML document - this works fine.
The second and third look for remote files, and these do not work. The locations are correct and I have viewed page source and opened the links to check this.

When I click them nothing happens and the webapp becomes unresponsive until I refresh the page. 

The contents of testview.html is as follows:
<div data-role="view" id="side-view">
  <p>This is a remote view</p>
</div


It is necessary for my webapp to be hosted for this to work? Can remote files not work offline? 

Thanks in advance,
Andrew.

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 11 Sep 2013, 02:42 PM
Hello Andrew,

Remote Views are fetched via Ajax request and are injected into the DOM tree. If you open the application from the local file system (e.g. the address looks like file:///C:/work/examples/app.html) the browser will not be able to perform Ajax request, as a result the View will not be loaded.

You should host the application on a web server even if it is a local one and access the it via http protocol. For example http://localhost/work/examples/app.html

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or