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

Combo Box and RequireJS

3 Answers 38 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Santhosh
Top achievements
Rank 1
Santhosh asked on 16 Dec 2013, 05:39 PM
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

3 Answers, 1 is accepted

Sort by
0
Mihai
Telerik team
answered on 17 Dec 2013, 08:46 AM
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!
0
Santhosh
Top achievements
Rank 1
answered on 17 Dec 2013, 03:44 PM
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.
0
Mihai
Telerik team
answered on 18 Dec 2013, 10:05 AM
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!
Tags
ComboBox
Asked by
Santhosh
Top achievements
Rank 1
Answers by
Mihai
Telerik team
Santhosh
Top achievements
Rank 1
Share this question
or