Telerik Forums
Kendo UI for jQuery Forum
3 answers
114 views

After working on a multi-view page for a couple of months, the shareholders have recently added a requirement that the back button work "as expected". I've found the SPA/layout/router functionality of KendoUI, which appears to be what I need, but I'm rather lost as to how to convert my existing functionality to use it. Also, please note that this is my first time using KendoUI, or working w/ a single page application, so my initial solution is probably not ideal in many respects.

I've hosted an example version of my application here: app.smarteru.com/custom/kendo/index.cfm, as well as attaching the source code as a zip file. I've stripped out a lot of the extraneous UI bits, but I've left the util.js fully intact (including functions that won't actually be called by the example), so you can see the general idea of the page as a whole.

I would appreciate some general guidance/an example of how I can get my tile and list views working within the layout/router framework. You'll notice in the generateCourseView in util,js, I'm handing the hiding/showing of the tile and list display divs on my own (as well as hiding other views, which I've removed from the example for simplicity).

I do have a few specific questions, in addition to the general request for guidance:

  • Our standard URLs always include a ?AccountID=1234 parameter, which we'll need to keep. How/will this work w/ the layout/router?
  • Can I link to a specific view from another location, while passing another URL parameter? For example, when a course is completed, we want to link back to the course index view (not included in the example), but we need to pass the course completion ID. In our current system, the URL would look something like "course-index.cfm?AccountID=1234&AULMRID=7894". How do I handle this w/ the layout/router functionality?
Petyo
Telerik team
 answered on 06 Jul 2015
9 answers
178 views

Hi,

Can you help me with my dojo here? In this experiment I'm trying to redirect to the login-view. Doesn't work, neither in the change event nor in the route callbacks. Plus using the change event produces an infinite loop (on FF38).

Regards,

Kasimier Buchcik

Petyo
Telerik team
 answered on 23 Jun 2015
8 answers
169 views
Hello everyone,
When using the Router, I have been experiencing a weird effect involving 2 routers and deep linking.

I've isolated the problem down to this test:
var router1 = new kendo.Router();
router1.route("/test1/", function (){
    alert("test1");
});
var router2 = new kendo.Router();
router2.route("/test2/", function (){
    alert("test2");
});
 
router1.start();
router2.start();
The routing works fine when you start from /, then navigate to /#/test1/ But when using a deep link (e.g.: open a new tab and navigate directly to /#/test1/), then the callback is triggered twice; 2 times "test1" is shown in an alert.
This is not the case when navigating directly to /#/test2/

Just for fun, I added a third router, which caused 3 alerts of test1, and 2 alerts of test2... It looks like the initialization of one router triggers an additional change event in the previous routers.

Best regards,
Wannes.
Petyo
Telerik team
 answered on 03 Jun 2015
1 answer
26 views

I notice strange behaviour in Google Webmaster Tools. Google crawler found some links that doesn't exists. I first though that Google doesn't handle properly my (ajax) sitemap.xml, until I notice this 404 error in Webmaster Tools:

URL:https://domerus.si/realestates/*id

The only place where string "realestates/*id" appears is in init kendo router route:

Application.router.route('/realestates/*id', function (id)
{
    if (id) //load content and add it to the DOM
        Application.navigate("realestates", null, { name: id, fileName: "realestate", parameters: { ID: id } });
});
Where Application.router is kendo.Router.

I already asked how can I fix this on Google support, but since I am starting to feel kendo is responsible for this, I am also posting it here.

Petyo
Telerik team
 answered on 21 May 2015
3 answers
125 views

Hi,

We are trying to use a spa project template that Kendo put up on the Visual Studio Gallery https://visualstudiogallery.msdn.microsoft.com/924c3074-ceab-4be4-87e1-e9e4fd4b6d61 , The problem we are having is when building the requirejs app with the optimizer r.js, the app runs and no errors but the templates are not rendering, I can see that the templates have been included in the built file. The app and templates render no problem when not using the optimizer. 

I have attached a project with the problem,

 

Templates not rendering when using built file 

<script src="@Url.Content("~/Scripts/require.js")" data-main="@Url.Content("~/App/main-built")"></script>

 

Templates rendering with non built file

  <script src="@Url.Content("~/Scripts/require.js")" data-main="@Url.Content("~/App/main")"></script>

 

Can anyone shed some light on this please?

 

Thanks

N.

Negin
Top achievements
Rank 1
 answered on 23 Apr 2015
6 answers
248 views

I am receiving this error when attempting to use Kendo UI Mobile /SPA features:

Error: Your kendo mobile application element does not contain any direct child elements with data-role="view" attribute set. Make sure that you instantiate the mobile application using the correct container

I have one index.html page:

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Global Client Dashboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<!--
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
-->
 
<!-- CSS -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/login.css">
<link rel="stylesheet" href="js/libs/kendoui/styles/kendo.mobile.all.min.css">
 
<!-- jQuery -->
<!-- Using the jQuery in Kendo UI -->
<script src="js/libs/kendoui/js/jquery.min.js"></script>
 
<!-- Angular JS -->
<script src="js/libs/kendoui/js/angular.min.js"></script>
 
<!--  Kendo UI -->
<script src="js/libs/kendoui/js/kendo.all.min.js"></script>
 
<!-- application scripts -->
<script src="js/app.js"></script>

</head>
<body style="display: none;" kendo-mobile-application k-hash-bang="true" ng-app="gcdApp">
 
    <!-- Default View - needed for routing -->
    <div data-role="view"></div>
 
    <!-- Header and Footer -->
    <kendo-mobile-layout k-id="'default'">
        <kendo-mobile-header>
            <kendo-mobile-nav-bar>
                <kendo-view-title></kendo-view-title>
                    <!-- <kendo-mobile-button class="about-button" k-align="'right'" href="views/about.html">About</kendo-mobile-button> -->
            </kendo-mobile-nav-bar>
        </kendo-mobile-header>
        <kendo-mobile-footer>
            <kendo-mobile-tab-strip>
                <a href="views/accounts.html" data-icon="home">Home</a>
                <a href="views/about.html" data-icon="info">About</a>
                <a href="views/more.html" data-icon="more">More</a>
            </kendo-mobile-tab-strip>
        </kendo-mobile-footer>
    </kendo-mobile-layout>
 
    <script>
        new kendo.mobile.Application($(document.body), { initial: "views/login.html" });
    </script>
 
    <!-- Standard Worklight Stuff -->
    <script src="js/initOptions.js"></script>
    <script src="js/main.js"></script>
    <script src="js/messages.js"></script>
 
    <!--  Controllers -->
    <script src="js/controllers/controllers.js"></script>
    <script src="js/controllers/accounts.js"></script>
    <script src="js/controllers/metrics.js"></script>
 
</body>
</html>

I followed this tutorial to get this page up and running:
http://blogs.telerik.com/kendoui/posts/13-08-01/kendo-ui-mobile-remote-views-and-separate-html-files

 

I found this post in the forum, however, I am not sure how to plug into my index.html to get to work:

http://www.telerik.com/forums/problems-getting-kendo-to-work

 

I was hoping to get some help to get this to work correctly.

Thanks!
Dan

 

Petyo
Telerik team
 answered on 22 Apr 2015
1 answer
175 views

I have been tasked with adding a Login page to a Kendo UI Mobile project.  The Login page needs to appear first when the user opens the application.  I also need to make this application an SPA application, using the router (or not using the router is easier).

Here is the existing index.html:

<!DOCTYPE HTML>
<html>
        <head>
            <meta charset="UTF-8">
            <title>Global Client Dashboard</title>
            <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
            <!--
                <link rel="shortcut icon" href="images/favicon.png">
                <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
            -->
             
            <!-- CSS -->
            <link rel="stylesheet" href="css/main.css">
            <link href="js/libs/kendoui/styles/kendo.mobile.all.min.css" rel="stylesheet" />
             
            <!-- jQuery -->
            <!-- Using the jQuery in Kendo UI -->
            <script src="js/libs/kendoui/js/jquery.min.js"></script>
             
            <!-- Angular JS -->
            <script src="js/libs/kendoui/js/angular.min.js"></script>
             
            <!--  Kendo UI -->
            <script src="js/libs/kendoui/js/kendo.all.min.js"></script>
             
            <!-- application scripts -->
            <script src="js/app.js"></script>
             
        </head>
        <body style="display:none;" kendo-mobile-application k-hash-bang="true" ng-app="gcdApp">
             
            <!--application UI goes here-->
             
            <!--  Accounts -->
            <kendo-mobile-view id="accounts" k-title="'Customer Accounts'" k-layout="'default'" ng-controller="AccountsController">
                <kendo-mobile-list-view id="accountslist" class="item-list"
                    k-template="templates.accountsTemplate" k-data-source="gcdAccounts.accountsDataSource">
                </kendo-mobile-list-view>
            </kendo-mobile-view>
             
            <!--  Metrics - Historical Performance -->
            <kendo-mobile-view id="metrics" k-transition="'slide'" k-title="'Historical Performance'" k-layout="'default'" ng-controller="MetricsController" k-on-show="setCurrentItem(kendoEvent)">
                <kendo-mobile-header>
                    <kendo-mobile-nav-bar>
                        <kendo-mobile-back-button k-align="'left'">Accounts</kendo-mobile-back-button>
                        <kendo-view-title>Historical Performance</kendo-view-title>
                    </kendo-mobile-nav-bar>
                </kendo-mobile-header>
                <kendo-mobile-content>
                    <h2>{{gcdAccounts.currentItem.custname}}</h2>
                     
                    <!-- Client Experience Metric - Transaction -->
                    <div style="margin-left:5px;">
                        <div kendo-chart class="chart-halfwidth chart-left-top"
                             k-title="{ text: 'Client Experience Metric - Transaction' }"
                             k-legend="{ position: 'bottom' }"
                             k-series-defaults="{ type: 'column', stack: true, categoryField: 'month', labels: {visible: false} }"
                             k-series="[
                                             { field: 'q2avg', name: 'Avg', color: 'green' },
                                             { field: 'miss', name: 'Miss', color: 'red' }
                                         ]"
                             k-value-axis="{ min:0, max:10, plotBands: [{ from: 8.0, to: 8.05, color: 'black' }] }"
                             k-category-axis="{ labels:{ visible:true } }"
                             k-data-source="cexpDataSource"
                             k-series-click="transactionClicked" >
                        </div>
                    </div>
                     
                    <!-- Hardware Billing Accuracy -->
                    <div style="margin-left:5px;">
                        <div kendo-chart class="chart-halfwidth chart-right-top"
                             k-title="{ text: 'HW Billing Accuracy' }"
                             k-legend="{ position: 'bottom' }"
                             k-series-defaults="{ type: 'column', stack: { type: '100%' }, categoryField: 'month', labels: {visible: false} }"
                             k-series="[
                                             { field: 'okcnt', name: 'Make', color: 'green' },
                                             { field: 'defects', name: 'Miss', color: 'red' }
                                         ]"
                             k-value-axis="{ plotBands: [{ from: 0.95, to: 0.955, color: 'black' }] }"
                             k-category-axis="{ labels:{ visible:true } }"
                             k-data-source="hwbillDataSource">
                        </div>
                    </div>
                     
                    <!-- Dispute Cycle Time -->
                    <div style="margin-left:5px;">
                        <div kendo-chart class="chart-halfwidth chart-left"
                             k-title="{ text: 'Dispute Cycle Time' }"
                             k-legend="{ position: 'bottom' }"
                             k-series-defaults="{ type: 'column', categoryField: 'month', labels: {visible: false} }"
                             k-series="[
                                             { field: 'cycletime', name: 'Cycle Time', color: 'green' }
                                         ]"
                             k-value-axis="{ min:0, max:60, plotBands: [{ from: 30, to: 30.3, color: 'black' }] }"
                             k-category-axis="{ labels:{ visible:true } }"
                             k-data-source="dctDataSource">
                        </div>
                    </div>
                     
                    <!-- On Time Delivery -->
                    <div style="margin-left:5px;">
                        <div kendo-chart class="chart-halfwidth chart-right"
                             k-title="{ text: 'On Time Delivery' }"
                             k-legend="{ position: 'bottom' }"
                             k-series-defaults="{ type: 'column', stack: { type: '100%' }, categoryField: 'month', labels: {visible: false} }"
                             k-series="[
                                             { field: 'okcnt', name: 'Make', color: 'green' },
                                             { field: 'defects', name: 'Miss', color: 'red' }
                                         ]"
                             k-value-axis="{ plotBands: [{ from: 0.95, to: 0.955, color: 'black' }] }"
                             k-category-axis="{ labels:{ visible:true } }"
                             k-data-source="otdDataSource">
                        </div>
                    </div>
                     
                    <!-- Services Billing Accuracy -->
                    <div style="margin-left:5px;">
                        <div kendo-chart class="chart-halfwidth chart-left"
                             k-title="{ text: 'Services Billing Accuracy' }"
                             k-legend="{ position: 'bottom' }"
                             k-series-defaults="{ type: 'column', stack: { type: '100%' }, categoryField: 'month', labels: {visible: false} }"
                             k-series="[
                                             { field: 'okcnt', name: 'Make', color: 'green' },
                                             { field: 'defects', name: 'Miss', color: 'red' }
                                         ]"
                             k-value-axis="{ plotBands: [{ from: 0.95, to: 0.955, color: 'black' }] }"
                             k-category-axis="{ labels:{ visible:true } }"
                             k-data-source="svcbillDataSource">
                        </div>
                    </div>
                 
                </kendo-mobile-content>
            </kendo-mobile-view>
             
            <!-- Header and Footer -->
          <kendo-mobile-layout k-id="'default'">
            <kendo-mobile-header>
                <kendo-mobile-nav-bar>
                    <kendo-view-title></kendo-view-title>
<!--                    <kendo-mobile-button class="about-button" k-align="'right'" href="views/about.html">About</kendo-mobile-button> -->
                </kendo-mobile-nav-bar>
            </kendo-mobile-header>
         
            <kendo-mobile-footer>
                <kendo-mobile-tab-strip>
                    <a href="#!accounts" data-icon="home">Home</a>
                    <a href="views/about.html" data-icon="info">About</a>
                    <a href="#!" data-icon="more">More</a>
                </kendo-mobile-tab-strip>
            </kendo-mobile-footer>
        </kendo-mobile-layout>
         
        <!--  Templates -->
        <!-- k-on-click="gcdAccounts.addToCart(kendoEvent, dataItem)" -->
        <script id="accountsTemplate" type="text/x-kendo-template">
            <a class="details-link" data-role="listview-link" href="\#!metrics?id={{dataItem.id}}">
                {{ dataItem.custname }}
            </a>
        </script>
         
        <!-- Standard Worklight Stuff -->
        <script src="js/initOptions.js"></script>
        <script src="js/main.js"></script>
        <script src="js/messages.js"></script>
         
        <script type="text/javascript">
            WL.Logger.debug("Loading main page");
        </script>
         
        <!--  Controllers -->
        <script src="js/controllers/controllers.js"></script>
        <script src="js/controllers/accounts.js"></script>
        <script src="js/controllers/metrics.js"></script>
         
         
         
    </body>
</html>

I have a few questions:

1. What determines, in the above .html, the first page/view that will appear?

2. How do I add an existing login.html into this page?

3. If I am to use the router, how to I add this feature to the existing index.html?  Does each view become a template and how would I do that?

4. Once the login page is authenticated/passes, how do I open the Accounts view?  Does this need to be put into a router or not?

I have been reviewing examples online, but I don't see samples on how to accomplish what I need to do.

Thanks!
Dan

 

 

Petyo
Telerik team
 answered on 10 Apr 2015
3 answers
172 views

I have a few questions:

1. With Kendo UI and its routing features, can they be broken into separate .html pages, so not to have all code in one index.html?  Or does it all have to be on one .html page with templates, routing, controllers, etc.?  I wanted to keep the index.html separate and easy to read and keep all other pages in a "views" folder.

2. Is it better to use Angular routing with Kendo UI features or does it not work correctly?

I see with Angular, you can use a placeholder:

<div ng-view>
</div>
to display the .html that is chosen (as explained here -- https://docs.angularjs.org/tutorial/step_07) in the Angular routing process, such as:

gcdApp.config([ '$routeProvider', function($routeProvider) {
    $routeProvider.
    when('/login', {
        templateUrl : 'views/login.html',
        controller : 'LoginController'
    }).
    when('/loginSuccess', {
        templateUrl : 'views/sushi.html',
        controller : 'LoginSuccessController'
    }).
    otherwise({
        redirectTo : '/login',
 
    });
    ;
} ]);
I have gone through the Sushi demo (http://docs.telerik.com/kendo-ui/mobile/angular/sushi-angular-tutorial) as well as reviewing this GitHub demo (https://github.com/rstropek/Samples/blob/master/KendoOverviewSample/SPASample.html), but I am not sure how to break all this into separate .html pages.

If there are any demos/tutorials that show exactly what I am looking for, please let me know.  Or if you can provide code that spells all this out, I would really appreciate this.  I am new to the Kendo UI SPA/Routing coding/processes and I can understand Angular a little better.

Thanks!
Dan

Petyo
Telerik team
 answered on 10 Apr 2015
3 answers
223 views
I am not very familiar with routing, so I appreciate any extra help with this (and some patience too - thanks!)...

I have an existing index.html and app.js file using Angular routing.  I need to convert to Kendo UI routing to keep the SPA architecture.

Here is my app.js

var app = angular.module('App', [ 'ngRoute' ]);
 
var busyIndicator = new WL.BusyIndicator('content', {
    text : "Loading ...",
    bounceAnimation : false,
    fullScreen : true,
    minDuration : 3,
    textColor : "black",
    opacity : 1,
    strokeOpacity : 0.25
});
app.factory("busyIndicator", function() {
    return busyIndicator;
});
 
app.config([ '$routeProvider', function($routeProvider) {
    $routeProvider.
    when('/module', {
        templateUrl : 'views/modules.html',
        controller : 'ModuleController'
    }).
    when('/module/:moduleId', {
        templateUrl : 'views/level.html',
        controller : 'LevelController'
    }).
    when('/module/:moduleId/:levelId', {
        templateUrl : 'views/quiz.html',
        controller : 'QuizController'
    }).
    when('/rank', {
        templateUrl : 'views/rank.html',
        controller : 'RankController'
    }).
    when('/help', {
        templateUrl : 'views/help.html',
        controller : 'HelpController'
    }).
    when('/result', {
        templateUrl : 'views/result.html',
        controller : 'ResultController'
    }).
    when('/nick', {
        templateUrl : 'views/nickname.html',
        controller : 'NickController'
    }).
    when('/login', {
        templateUrl : 'views/login.html',
        controller : 'LoginController'
    }).
    when('/loginSuccess', {
        templateUrl : 'views/loginSuccess.html',
        controller : 'LoginSuccessController'
    }).
    otherwise({
        redirectTo : '/login',
 
    });
    ;
} ]);

Here is the index.html (code where the SPA is used):
..
            <script src="js/app.js"></script>
        </head>
        <body>
 
            <div ng-class="tabClass">
                <div class="app_view ng-view">
                </div>
            </div>
 
        </body>
...

I have read through some documentation and tutorials, but I am not sure how to begin this or what I should change.

Please let me know what I need to do to get this up and running.

Thanks!


Petyo
Telerik team
 answered on 08 Apr 2015
1 answer
85 views
I'm fairly new to KendoUI and was intrigued on the idea of building an SPA in Visual Studio.  After hunting around the internet I found a few different approaches and eventually found a project template that someone made: https://github.com/vbilopav/WebBoilerplateTemplate/.  This template is based on a few other similar templates are basically the same.

As I poked around I started to get an idea of how the routing, views and layouts.  For simple development everything ran smoothly but then I tried to add the sample grid provided by Telerik and started scratching my head (http://docs.telerik.com/kendo-ui/web/grid/how-to/kendo-grid-in-spa-application).  For the sake of just merely learning can you provide me an example on how I would implement your kendo-grid in this project?  I'm just trying to add a dummy grid to the details view.
Alexander Popov
Telerik team
 answered on 27 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?