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

App.navigate function does not exist

2 Answers 36 Views
Show your code
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nikolaus
Top achievements
Rank 1
Nikolaus asked on 20 Apr 2017, 03:16 PM

Hi,

 

I'm trying to navigate within my app, but it seems that the app variable isn't defined in the usual way. I didn't create any of the framework myself (the app is based on the default template), but when I try to use app.navigate, I get an error that that function does not exist. When I checked my app.js, it seems like a custom app is being defined, instead of using app = new kendo.mobile.Application. How do I navigate in my app while keeping my layout page? The nav links on the layout page just use anchor tags (href=view/example.html) but if I try that anywhere else, it obviously opens the page without the layout.

2 Answers, 1 is accepted

Sort by
0
Nikolaus
Top achievements
Rank 1
answered on 20 Apr 2017, 03:27 PM

For some reason I had to use:

app.mobileApp.navigate("path/view.html");

0
Accepted
Martin
Telerik team
answered on 24 Apr 2017, 08:38 AM

Hi Nikolaus,

I assume your are using the Views service of Telerik Platform. There the mobile app indeed is created not in "app" variable but in "app.mobileApp":

app.mobileApp = new kendo.mobile.Application(document.body, {
    skin: 'nova',
    initial: 'components/home/view.html'
});
 
// navigate to a remote view
app.mobileApp.navigate("settings.html");

Therefore you have to use app.mobileApp for all subsequent methods, like navigation. This is the main difference with the documentation on navigation where navigation is the following:

var app = new kendo.mobile.Application();
 
// navigate to a remote view
app.navigate("settings.html");

I hope this has helped.

Regards,
Martin
Telerik by Progress
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Show your code
Asked by
Nikolaus
Top achievements
Rank 1
Answers by
Nikolaus
Top achievements
Rank 1
Martin
Telerik team
Share this question
or