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

RequireJS aspnetmvc missing dependencies

1 Answer 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vasile
Top achievements
Rank 1
Vasile asked on 18 Apr 2013, 01:28 PM
Hello,
I am using Kendo UI Web with RequireJS in an ASP.MVC 4 application. Recently I reached the folowing situation:
In a form I am using MultiSelect control and I try to load required kendo components with requirejs using the following pseudocode:
<script>
require(['other_modulea','kendo-multiselect','kendo-aspnetmvc'], function(){
     // execute deffered controls initialization scripts.
});
</script>

But there is no dependency established between kendo-aspnetmvc and kendo-multiselect (and kendo-combobox - seems to have similar issues). It happens that aspnetmvc executes before kendo-multiselect fulfills it's dependencies, this results in aspmvc not being able to attach to ComboBox and MultiSelect the requestData function. This function is called on deffered initialization script and because aspnetmvc script was loaded prior to kendo-multiselect the function is not available.
It seems that despite the order of modules in requirejs the execution order of the modules is not guaranteed as long as there are no dependencies between them.

Do you have any ideea how this could be solved?

One way could be:
<script>
require(['other_modulea','kendo-multiselect'], function(){
    require(['kendo-aspnetmvc'], function(){
         // execute deffered controls initialization scripts.
     });
});
</script>
but I would really preffer a more generic approach instead on doing this nested require all over the application.

Thanks,
Vasile

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Apr 2013, 11:33 AM
Hello Vasile,

 
Currently, the kendo.aspnetmvc.js depends on kendo.data.js only. We will change this in the next internal build due the mid of this week. Check it and let me know if the problem still persists.
I updated your Telerik points, because of the finding.

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Vasile
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or