Data-init function occurring on second view show?

2 posts, 0 answers
  1. Filip
    Filip avatar
    35 posts
    Member since:
    Jul 2013

    Posted 13 Sep 2013 Link to this post


    I have a problem, I dont know why but my data-init function in a main view is being called when I navigate back to that page for the first time. Shouldn't it be called only when its displayed for the first time? I want to separate some initialization logic from show logic in the starting view.

    View is defined as a first (and only) view inside the body element.

    <div data-role="view" id="..."  data-model="..." data-init="initFnc"  data-show="show">

     I create the app like this:
    var app = new, { transition: "slide" });

    So once again sequence of events, just to be clear: started, main view opened -> init and show functions called
    2.navigate away, navigate back -> init and show functions called
    3.navigate away, navigate back -> show function called

    In step 2, I want to call only the "show" function.

  2. Kiril Nikolov
    Kiril Nikolov avatar
    2598 posts

    Posted 17 Sep 2013 Link to this post

    Hello Filip,

    I can see that you have asked the same question on StackOverflow and you already got an answer from colleague of mine (correct me if I am wrong). Anyway here is a link to the topic that I am referring to:
    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