Backbutton goes to "first" page instead of previous page

4 posts, 0 answers
  1. M
    M avatar
    4 posts
    Member since:
    Oct 2012

    Posted 16 Oct 2012 Link to this post

    I have a layout with a back button:
    <div data-role="layout" data-id="infoPageLayout">
     <header data-role="header">
      <div data-role="navbar">
       <a class="nav-button" data-align="left" data-role="backbutton">Back</a>
        <span data-role="view-title"></span>
      </div>
     </header>
    </div>

    I get to that view from a 'click' event with app.navigate('#infoPage');
    When I click the Back button, it goes to the view at the top of my html file (the default view) instead of the previous view.

    Is there anything that might be causing this?
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 19 Oct 2012 Link to this post

    Hello,

    I tested a similar scenario and got everything to work as expected. Could you please check my demo page and let me know what I am missing? Can you reproduce the problem in my example and send me a back a link with the updated version?
    Please provide such example and I will check it right away.

    Regards,
    Alexander Valchev
    the Telerik team
    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
  4. M
    M avatar
    4 posts
    Member since:
    Oct 2012

    Posted 19 Oct 2012 Link to this post

    Thanks for taking a look Alexander.

    I've edited it to reflect a shell of my app.

    With this version the back button on the View "thirdPage" doesn't work at all, and as soon as that View loads, my debugger is showing an "Uncaught Error: Syntax error, unrecognized expression: #" error.
    The back button on "barPage" does work, however.

    http://jsbin.com/amuwal/6/edit

  5. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 24 Oct 2012 Link to this post

    Hi,

    The page throws an error because #bazButton has a href="#" attribute. If you want to link the view via button you should set a valid View id as a href attribute. For more information please check this help topic. Of course you can use the click function and navigate through the navigate method, but in that case please omit the href attribute of the link element.

    Also it is recommended to use the click event of the widget instead of jQuery click event.
    For convenience I updated your example: http://jsbin.com/amuwal/11/edit 

    Note that I added data-title attributes to the Views in order to fix the broken layout.

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready