Pass parameters to View in separate html file

2 posts, 0 answers
  1. Teo
    Teo avatar
    4 posts
    Member since:
    Dec 2013

    Posted 02 Sep 2014 Link to this post


    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>

    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?
  2. Kiril Nikolov
    Kiril Nikolov avatar
    2596 posts

    Posted 04 Sep 2014 Link to this post

    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:

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top