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

Change Kendo Vue UI dynamically with local scripts

1 Answer 84 Views
This is a migrated thread and some comments may be shown as answers.
Emilio
Top achievements
Rank 1
Emilio asked on 11 Mar 2021, 08:50 AM

Hi, we have a multilanguage application and we need to change the Kendo UI for Vue language dynamically.

Currently, we were doing it like this and it worked:

 

var that = this;
      var selectedLang = this.$refs.dl.kendoWidget().value();
      $.getScript("https://kendo.cdn.telerik.com/2018.3.1017/js/messages/kendo.messages." + selectedLang + ".min.js", function() {
        var lb = that.$refs.lb.kendoWidget();
        lb.setOptions({
          messages: kendo.ui.ListBox.fn.options.messages
        });
      });

 

But we need the script to grab it locally for possible own modifications. I am trying this way :

var that = this;
            var script = document.createElement('script');
           
            script.src = "../../../../storage/kendo-grid/messages/kendo.messages." +selectedLang+ ".min.js";
            if(document.head){
                document.head.appendChild(script);
                var lb = that.$refs[ref].kendoWidget();
                lb.setOptions({
                    messages: kendo.ui.ListBox.fn.options.messages
                });
            }

 

But it gives me a javascript error when pointing to the script ('Module is not defined').

Could you guide me a bit? Thanks!









1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 12 Mar 2021, 10:37 AM

Hi Emilio,

Can you share the exact error that you get? Maybe a screenshot of it? 

Another thing I can suggest is to check this Kendo UI for jQuery forum thread that discusses a functionality similar to the one you want to implement. Another link you may find useful is this one

Let me know if the above links help you resolve the issue in your application.

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Asked by
Emilio
Top achievements
Rank 1
Answers by
Petar
Telerik team
Share this question
or