Routing to Other Pages?

6 posts, 0 answers
  1. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 08 Mar 2013 Link to this post

    Hello,

    Is the approach to Kendo to use templates to route between views on a single page?  Does it support navigation between multiple HTML pages, for example, like the approach Windows takes to single page applications?

    Thanks.
  2. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 10 Mar 2013 Link to this post

    Navigation between multiple HTML pages is not done with Kendo SPA. Routes are used for switching between several views on a single HTML page with the help of the hash fragment.

    What is the advantage of having multiple HTML pages in a single page application? And if you want to jump between several pages, why not use normal anchor elements?

    Michael G. Schneider
  3. Kendo UI is VS 2017 Ready
  4. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 14 Mar 2013 Link to this post

    There is great benefit to routing between pages.  Think from the perspective of windows store apps, where you can route between HTML pages, while keeping the main parent context.  The framework builds a history representation between these pages.  With in-page routing, I don't really see a huge benefit to what you already have with navigation between multiple views, other than the aspect of history (which is that a feature that's present?)
  5. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 14 Mar 2013 Link to this post

    I do not yet understand the advantages completely and how the navigation between multiple pages should work. Some thoughts...

    If you want to navigate to another HTML page, then a new HTML page will be loaded into the browser. Or did I misunderstand that? Who will then be responsible for maintaining the application's context?

    One of the SPA's benefits is minimzing the traffic between client and server. With regard to that, routing to other pages wouldn't be so good.

    Yes, history is supported. Back and Forward work as expected.

    Michael G. Schneider
  6. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 14 Mar 2013 Link to this post

    Routing between multiple pages does not redirect the entire browser contents, but loads the inner contents in an AJAX fashion.  I understand what you are saying about minimizing client and server traffic,though if you have a page with 5 large views, you are loading a lot of HTML potentially in one shot... breaking that up into multiple pages can be a benefit too.
  7. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 14 Mar 2013 Link to this post

    Hello Brian,

    this makes your question clearer. When reading your initial question about "navigation between multiple HTML pages" I really thought that you wanted to load a new HTML page into the browser. Just the same, as if the user had clicked an anchor element.

    Having read your last post, let me answer the question again. Having done some tests with Kendo SPA...

    I do not load all HTML for all views in the initial page load. I only load the very first view's HTML. Then in the Javascript that is bound to the route a "$.get" is done for loading the new partial HTML. This is then put into the main page with "showIn".

    Michael G. Schneider
Back to Top
Kendo UI is VS 2017 Ready