app.navigate() in data-before-show

2 posts, 0 answers
  1. Robby Parker
    Robby Parker avatar
    18 posts
    Member since:
    Jul 2012

    Posted 15 Jul 2015 Link to this post

    I can't seem to get app.navigate to switch to a local view. No errors in console.

    Please tell me why this simple example doesn't work.

    HTML:

    <div data-role="view" data-layout="default" id="journalDefault" data-before-show="doesNeedLogin">
        Journal Entries
    </div>
     
    <div data-role="view" data-layout="default" id="journalAddNew">
        Add Entry. Get ID from Listview.
    </div>
     
    <div data-role="view" data-layout="default" id="journalLogin">
        Need to login.
    </div>

    JS:

    function doesNeedLogin(e)
    {
        var isLoggedIn = false;
         
        if (isLoggedIn)
        {
            alert("Logged In");
        }
        else
        {
            alert("Not logged in");
             
            //show them login view
            app.navigate("#journalLogin");
        }
    }

  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 17 Jul 2015 Link to this post

    Hi,

    you need to call prevent default - please check the snippet in the documentation.
    Regards,
    Petyo
    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