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

    Hi,

    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">
    </div>

     I create the app like this:
    var app = new kendo.mobile.Application(document.body, { transition: "slide" });

    So once again sequence of events, just to be clear:
    1.app 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.

    Thanks!
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 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:

    http://stackoverflow.com/questions/18789517/data-init-function-executing-twice/18790931#18790931
     
    Regards,
    Kiril Nikolov
    Telerik

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top