Issue with local view when refresh browser.

4 posts, 1 answers
  1. XiMnet Malaysia
    XiMnet Malaysia avatar
    46 posts
    Member since:
    Jan 2006

    Posted 09 Dec 2014 Link to this post

    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.


  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 11 Dec 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. XiMnet Malaysia
    XiMnet Malaysia avatar
    46 posts
    Member since:
    Jan 2006

    Posted 11 Dec 2014 in reply to Kiril Nikolov Link to this post

    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.
  5. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 15 Dec 2014 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready