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

Issue with local view when refresh browser.

3 Answers 89 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
XiMnet Malaysia
Top achievements
Rank 1
XiMnet Malaysia asked on 09 Dec 2014, 08:58 AM
Hi,

In the URL http://telerik.ximnet.com.my/kendo_test/#views/test.html,
I have a link to local view, which will show http://telerik.ximnet.com.my/kendo_test/#localview after click.

However, if I refresh when address bar is showing http://telerik.ximnet.com.my/kendo_test/#localview, the browser will show blank page (404 in console).

My questions: 
A. Is there a way to show the localview to the user if they refresh when the address bar is showing http://telerik.ximnet.com.my/kendo_test/#localview?

B. If not, is there a way to redirect user back to the previous view at http://telerik.ximnet.com.my/kendo_test/#views/test.html ?

Thanks.


3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 11 Dec 2014, 08:59 AM
Hello XiMnet,

I will go straight to your questions:

1. When the page is refreshed and the url has the http://telerik.ximnet.com.my/kendo_test/#localview address it is normal to see the 404 error. In general the Kendo UI Mobile application is deployed 

2. You can navigate to previous view, using the global mobile application object like this:

kendo.mobile.application.navigate("yourview.html")

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
XiMnet Malaysia
Top achievements
Rank 1
answered on 12 Dec 2014, 01:37 AM
Hi,

For 2. You can navigate to previous view, using the global mobile application object like this:,

Is there a way to do detection when the Kendo UI Mobile application cannot find the view, then we redirect based on the hash value?

E.g.
a. The application detected #localview cannot be found, then we manually redirect them to the #parentview.
a. The application detected #localview_2 cannot be found, then we manually redirect them to the #parentview_2

Thanks.
0
Accepted
Kiril Nikolov
Telerik team
answered on 15 Dec 2014, 09:26 AM
Hello XiMnet,

There is no built-in way to detect whether the view exists or not, but you can use the pane navigate event to. However you can just check with jQuery if the element that you are looking for exists, and see if the there is such view or not. Here is a sample that you can use as a base reference:

http://dojo.telerik.com/utiN

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MVVM
Asked by
XiMnet Malaysia
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
XiMnet Malaysia
Top achievements
Rank 1
Share this question
or