I have setup the following routes in app.js

var loginApp = angular.module('loginApp', ['ui.router']);
loginApp.config(function($stateProvider, $urlRouterProvider) {
        $urlRouterProvider.otherwise('/login');
        $stateProvider

            // Login view
            .state('login', {
                url: '/login',
                templateUrl: 'templates/login.html'
            })

            // Company view
            .state('company', {
                url: '/company',
                templateUrl: 'templates/company.html'
            });
    });

and my company.html looks like this:

<div id="grid"></div><script>
    $(document).ready(function () {
        var crudServiceBaseUrl = "//demos.telerik.com/kendo-ui/service",
                dataSource = new kendo.data.DataSource({
                    transport: {
                        read:  {
                            url: crudServiceBaseUrl + "/Products",
                            dataType: "jsonp"
                        },
                        update: {
                            url: crudServiceBaseUrl + "/Products/Update",
                            dataType: "jsonp"
                        },
                        destroy: {
                            url: crudServiceBaseUrl + "/Products/Destroy",
                            dataType: "jsonp"
                        },
                        create: {
                            url: crudServiceBaseUrl + "/Products/Create",
                            dataType: "jsonp"
                        },
                        parameterMap: function(options, operation) {
                            if (operation !== "read" && options.models) {
                                return {models: 
kendo.stringify(options.models)};
                            }
                        }
                    },
                    batch: true,
                    pageSize: 20,
                    schema: {
                        model: {
                            id: "ProductID",
                            fields: {
                                ProductID: { editable: false, nullable: true },
                                ProductName: { validation: { required: true } },
                                UnitPrice: { type: "number", validation: { 
required: true, min: 1} },
                                Discontinued: { type: "boolean" },
                                UnitsInStock: { type: "number", validation: { 
min: 0, required: true } }
                            }
                        }
                    }
                });

        $("#grid").kendoGrid({
            dataSource: dataSource,
            pageable: true,
            height: 550,
            toolbar: ["create"],
            columns: [
                "ProductName",
                { field: "UnitPrice", title: "Unit Price", format: "{0:c}", 
width: "120px" },
                { field: "UnitsInStock", title:"Units In Stock", width: "120px" 
},
                { field: "Discontinued", width: "120px" },
                { command: ["edit", "destroy"], title: " ", width: "200px" }],
            editable: "inline"
        });
    });</script>

When I select the company tab - nothing is coming up on the page.

My question is how to make KendoUI Grid appear using AngularJS routes. Can you 
JSFiddle this?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to