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

Pass parameters to View in separate html file

1 Answer 195 Views
View
This is a migrated thread and some comments may be shown as answers.
Teo
Top achievements
Rank 1
Teo asked on 02 Sep 2014, 01:51 PM
Hello,

This is my view:
<div id="viewemail" data-role="view" data-title="Email" data-layout="main" data-show = "email_loaded">
  <div id="email-subject"></div>
  <div id="email-body"></div>
</div>

This is how I open the view:
<a data-role="button" href="#viewemail?emailId=5" ><div class="row" id="5">Random Subject</div></a>

The function called on data-show:
function email_loaded(e) {
    id = e.view.params.emailId;
    $('#email-subject').text('Subject with id:'+id);
}

If the first block of code (the view) is inside my index.html file - it works.
If I move the view to a separate html file (views/email.html) it throws the following error:

How can I make it work when the view is in a separate file?

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 04 Sep 2014, 08:17 AM
Hi Teo,

If I understand you correctly you want to link your views/email.html page, while your anchor tag links the #viewmail view. Please note that when view is specified with a hash the mobile application will look for the view in the current file (local view). I would suggest you to check the following documentation article that discussed the different views of a Kendo UI Mobile application:

http://docs.telerik.com/kendo-ui/getting-started/mobile/introduction#add-views-and-navigation

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