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

Kendo UI Grid with Angular and JSON data

1 Answer 425 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 21 Jul 2014, 05:50 PM
 I downloaded the trial version of Kendo UI Pro, 2014.2.716 and trying to get a simple grid working against JSON data. According to this site:

http://kendo-labs.github.io/angular-kendo

It's been deprecated and now included in the core. However, it's not at all clear if the trial version I downloaded includes the new directives or not. Since it included Angular, I kind of assumed it did.

I have a very simple page:

<div ng-app="App">
    <div ng-controller="TestGridController">
        <div kendo-grid k-options="testGridOptions"></div>
    </div>
</div>

The controller looks like this:

(function () {
    var testGridController = function ($scope) {
        $scope.testGridOptions = {
            dataSource: {
                type: 'json',
                transport: {
                    read: '/Home/TestData'
                },
                pageSize: 20
            },
            columns: [{
                field: 'Sample',
                title: 'Sample Item',
                width: '75px',
            }, {
                field: 'Sample2',
                title: 'Sample Item 2',
                width: '100px',
            }]
        };
    };

    app.controller('TestGridController', ['$scope', testGridController]);

}());

My page includes jQuery 2.11, bootstrap, the version of Angular included with Kendo, and kendo.web.min.js (in that order).

It's not clear on this page:

http://docs.telerik.com/kendo-ui/getting-started/javascript-dependencies

If kendo.core.min.js is included in kendo.web.min.js. I tried to include it but it didn't make any difference.
The page also hasn't been updated for the new Q2 version so I'm not sure if jQuery 2.11 works with it or not (since Q1 2014 works with 2.0x I'm going to assume that isn't the issue).

I don't see a GET occurring to load the data, so I'm assuming I've done something wrong. I'm not seeing any JS errors.


BTW - WHY isn't there a sample of the MOST COMMON way to pull data (JSON). OData? Really?

1 Answer, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 21 Jul 2014, 07:11 PM
It turns out I was missing the app dependency for Kendo directives:

var app = angular.module('App', ['kendo.directives']);
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Share this question
or