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

page (before) show events are only triggered once

2 Answers 134 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aidan
Top achievements
Rank 1
Aidan asked on 22 Oct 2013, 12:49 PM
Hi there,

I'm using Kendo UI Mobile for a mobile application for a client, but am struggling with the events. I have found that the page-show and before-show events are only called the first time a page is loaded. If I navigate to the same page once more these events aren't triggered a second time.

My html:
1.<div id="page_test" data-role="view" data-title="Test" data-before-show="beforeshow()" data-show="show()">
2.    <div class="view-content">
3.        Test!
4.    </div>
5.</div>
The javascript:
1.function beforeshow() {
2.    alert('beforeshow');
3.}
4. 
5.function show() {
6.    alert('show');
7.}
If this is the correct way the events should work, could someone offer any other ideas on events that trigger at for each page view?

Aidan Langelaan

2 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 22 Oct 2013, 01:15 PM
Hi Aidan,

The problem comes from the fact that you are calling the JavaScript function and not passing a reference to the function itself. Please check the following example:

http://jsbin.com/urERiMe/1/edit
 
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Aidan
Top achievements
Rank 1
answered on 22 Oct 2013, 01:39 PM
Thank you for your reply, this was indeed the solution! 

Aidan
Tags
General Discussions
Asked by
Aidan
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Aidan
Top achievements
Rank 1
Share this question
or