Window - Call function into the template

2 Answers 161 Views
Window
VB
Top achievements
Rank 1
Veteran
Iron
VB asked on 16 May 2021, 03:34 PM

Hi everybody,

I defined a window component with a onclick event in the template like that :

<window
        id="windowMD"
        :width="'300px'"
        :title="'Window title'"
        :actions="actions"
        :content="{
            url: 'http://localhost:3100/api/metadata',
            dataType: 'json',
            iframe: false,
            template:`
              <ul>
                # for (let i=0; i < data.mediaRequests.length; i++){ #
                    <li style='padding-bottom:5px;' onclick='#=eventClick(data.mediaRequests[i])#' > 
                      #= data.mediaRequests[i].id #
                    </li>
                # } # 
              </ul>
            `
        }"
    >
    </window>

But I have a problem when I click in a element in the list. I have a "the function is not defined" even if I declared it

[...]
methods: {
    eventClick: function(data) {
        console.log(data);
    }, 
  },
[...]

I see in this documentation that the function must be declared in the global scope but I need to use "$emits" to transfer data to parent component and I don't think it is possible in global scope. Even if it is possible, I have the same problem with the function ....

is there a solution to my problem ?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar
Telerik team
answered on 20 May 2021, 05:29 AM

Hi VB,

For the scenario you are working on, I would suggest you use the Native Window component. With it, you won't have the reported issues and will be able to implement the desired functionality. 

Check the Native Window and let me know if you have any additional questions.

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

0
VB
Top achievements
Rank 1
Veteran
Iron
answered on 20 May 2021, 06:57 AM

Hi Petar,

Before to use the wrapper window, I first used the native window but I think I have to purchase it right ? Because I read in the documentation that I must have license.

When I coded with the native, the code worked but I don't know if there is a limit of use without purchasing a license.

 

Thanks

 

Petar
Telerik team
commented on 21 May 2021, 11:24 AM

Hi VB,

All Kendo UI for Vue Native and Wrapper components work under a commercial license. If you are using the suite you have to buy a license no matter if you are working with the Wrapper or Native components. Since version 2.x.x of the Native component, you have to go through these steps to activate your license key. This doesn't mean that the older versions are license-free. 

More details about our license agreement, you can find in the Trial Version and Commercial License section here. The license details can even be found on the Wrapper Window  NPM package page

Regards,
Petar
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

VB
Top achievements
Rank 1
Veteran
Iron
commented on 24 May 2021, 01:04 PM

Thank you for the information. I haven't seen licence information in every documentation so I think there are some "non licence component", I did not look for more
Plamen
Telerik team
commented on 25 May 2021, 04:43 AM

Thank you for providing this information  - we will check the at our side once again. As for trail period - it is 30 days as it is described here - https://www.telerik.com/download-trial-file/v2-b/kendo-vue-ui. If you need additional trail days you could contact our support team and let us know.
Tags
Window
Asked by
VB
Top achievements
Rank 1
Veteran
Iron
Answers by
Petar
Telerik team
VB
Top achievements
Rank 1
Veteran
Iron
Share this question
or