page (before) show events are only triggered once

3 posts, 1 answers
  1. Aidan
    Aidan avatar
    8 posts
    Member since:
    Sep 2013

    Posted 22 Oct 2013 Link to this post

    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. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2598 posts

    Posted 22 Oct 2013 Link to this post

    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!
  3. Aidan
    Aidan avatar
    8 posts
    Member since:
    Sep 2013

    Posted 22 Oct 2013 Link to this post

    Thank you for your reply, this was indeed the solution! 

    Aidan
Back to Top