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

Data-init function occurring on second view show?

1 Answer 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Filip
Top achievements
Rank 1
Filip asked on 13 Sep 2013, 09:48 AM
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!

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 17 Sep 2013, 04:12 PM
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!
Tags
General Discussions
Asked by
Filip
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or