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

Backbutton Error

1 Answer 75 Views
Button (Mobile)
This is a migrated thread and some comments may be shown as answers.
Ethan
Top achievements
Rank 1
Ethan asked on 21 Jun 2013, 02:34 PM
If you have a back button in the header (like in the kendo mobile view demo), follow a link to an external site, then use the back button on the browser to go back to the kendo page, the back button no longer works. I had this happen with links to different sites on different views. Chrome throws the following error when you click the backbutton in the header after coming back from an external link:
Uncaught TypeError: Cannot call method split of undefined kendo.mobile.min.js:13

It looks like the app loses its internal history when you leave and come back. Is there a way to check the history, or have it default to go back to the home view?

I am using version 2013.1.514 of kendo mobile.

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 24 Jun 2013, 12:54 PM
Hello Ethan,

I already replied in the support ticket that you opened on the same subject. For convenience I will paste my reply here as well:

The problem occurs because when you open an external site the page reloads and mobile application loses its state.

As a workaround I suggest you to navigate back manually on click of the backbutton. If an error occurs you should catch it and navigate to the root View. For example:
<a class="nav-button" data-align="left" data-role="backbutton" data-click="goBack">Back</a>

function goBack(e) {
    e.preventDefault();
    try {
        app.navigate("#:back");
    } catch (e) {
        app.navigate("/");
    }
}


Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Button (Mobile)
Asked by
Ethan
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or