Combo Box and RequireJS

4 posts, 0 answers
  1. Santhosh
    Santhosh avatar
    1 posts
    Member since:
    Sep 2013

    Posted 16 Dec 2013 Link to this post

    Hello,
    I am trying to use requireJS with kendo.custom js. I downloaded kendo combobox and validator as a custom package and created a custom js. I am trying to use requireJS on this kendo.custom. 

    Code snippet that is NOT working

    define(["jquery/jquery","kendo/kendo.custom.min"],function() {
    return {
    init:function(){
    $("#vertical").kendoComboBox();
    var combobox = $("#vertical").data("kendoComboBox");
    }
    };
    });

    JS Error: Uncaught TypeError: Object [object Object] has no method 'kendoComboBox'

    But if I use kendo.all.min instead of kendo.custom.min, this code gets executed without any error. I think I am missing adding some dependency for combo box or probably using my requireJS in a wrong way. Can you please help.

    Thanks and Regards,
    Santhosh Rao M
  2. Mihai
    Admin
    Mihai avatar
    153 posts

    Posted 17 Dec 2013 Link to this post

    Hi,

    It's not clear to me how you created your kendo.custom but indeed, you must make sure to add all the files that combobox and validator depend on (and their dependencies in turn).  It can be a tedious process to do this manually, but we have automated tools to help you.

    You can use the Download Builder, available here: http://www.kendoui.com/custom-download

    Another option is to use the Kendo UI Bootstrapper, which has a feature to generate a custom build containing only widgets that your code uses.  https://github.com/kendo-labs/kendo-bootstrapper

    Hope this helps.

    Regards,
    Mihai
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Santhosh
    Santhosh avatar
    1 posts
    Member since:
    Sep 2013

    Posted 17 Dec 2013 Link to this post

    Hello Mihai,
    I did use http://www.kendoui.com/custom-download.aspx and chose combobox, it's mobile scroller and validator to download the custom js. Please let me know your thoughts.
  5. Mihai
    Admin
    Mihai avatar
    153 posts

    Posted 18 Dec 2013 Link to this post

    Hi Santhosh,

    I suspect the problem is as simple as adding "./" to the paths, i.e.:

    define([ "./jquery/jquery", "./kendo/kendo.custom.min" ], ...)

    (or otherwise configuring RequireJS paths correctly).  Could you please send me a ZIP with your files so I can take a look?

    Regards,
    Mihai
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready