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
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