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

loading kendo grid only, with angular and requirejs

3 Answers 183 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Growls
Top achievements
Rank 1
Growls asked on 09 Sep 2017, 01:26 AM

Hello,

I have the following setup:

//configuration
require.config({
    waitSeconds: 30,
    urlArgs: function () {
        var now = new Date();       
        return "?v=" + now.getTime();
    },
    paths: {       
        "jquery": ["//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min", "/Scripts/jquery-1.9.1"],
        "angular": "/Scripts/Angular/angular.min",
        "kendo.core": "/Scripts/kendo/2016.1.226/kendo.core.min",
        "kendo.grid": "/Scripts/kendo/2016.1.226/kendo.grid.min",
        "kendo.angular": "/Scripts/kendo/2016.1.226/kendo.angular.min",
        "kendo.data": "/Scripts/kendo/2016.1.226/kendo.data.min",
        "kendo.columnsorter": "/Scripts/kendo/2016.1.226/kendo.columnsorter.min",
        "BaseJS": "/Core/Scripts/BaseJS",
        "index.controller": "/DogsBreakfast/Scripts/Controller/index.controller"
    },
    shim:
    {
        "BaseJS": { deps: ["kendo.angular", "angular", "jquery"] },        
        "kendo.core": { deps: ["angular", "jquery"] },
        "kendo.angular": { deps: ["angular"] },
        "angular": {
            exports: "angular"
        },
        "jquery:": {
            exports: "jquery"
        },
        "index.controller": {
            deps: ["BaseJS"]
        }
    }
});

define(function (require) {
    //kick off index.controller.js
    require(["index.controller"],
        function ($) {            
            var app = angular.module('MyApp');            
            angular.bootstrap(document, ["MyApp"]);
        });
});

However, I keep getting " Module 'kendo.directives' is not available ", looking at the sequence of the js files loaded (attached), seems to be alright.
I have also, loaded the required module based on "http://www.telerik.com/download/custom-download".

 

Alternatively, I can easily fix this by loading "kendo.all.min", but it's just too big / too much...for a page that only needs a grid.

Is there a way to load kendo-ui module independently?

Thanks for your help,
Regards,

Aditya

 

3 Answers, 1 is accepted

Sort by
0
Growls
Top achievements
Rank 1
answered on 09 Sep 2017, 09:37 PM
Sorry, I uploaded a better screenshot and this time it loads up the kendo.core.min.js prior to the kendo.angular...but that didn't help either.
0
Growls
Top achievements
Rank 1
answered on 09 Sep 2017, 09:37 PM
Wooops...the file...
0
Stefan
Telerik team
answered on 13 Sep 2017, 07:09 AM
Hello Growls,

Currently, the demonstrated approach to load only the kendo.all.min.js is the only supported approach. The limitation when using the Download builder is listed in the important section of the documentation:

http://docs.telerik.com/kendo-ui/third-party/using-kendo-with-requirejs

I do understand that this is not the perfect approach when using the Kendo UI scripts, but this is specific which is caused by a combination of Kendo UI, AngularJS and RequireJS.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Growls
Top achievements
Rank 1
Answers by
Growls
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or