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

Cannot bind Model to View inside a KendoWindow

3 Answers 19 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 2
Veteran
Iron
Grant asked on 25 Sep 2019, 03:10 PM

Hi, 

Im trying to bind a model to the content of a kendoWindow but its just not responding. Kendo initializes the widgets in the window, but doesnt bind any data (see how the done button is still enabled).

Please advise: https://dojo.telerik.com/eYIMiLok

The reason for this binding strategy is that the entire code block (HTML and script) are loaded dynamically.

Thanks in advance, 
Grant

3 Answers, 1 is accepted

Sort by
0
Accepted
Ianko
Telerik team
answered on 27 Sep 2019, 10:47 AM

Hi Grant,

You can achieve that by having the element bound to the MVVM model before initializing the Kendo Window: https://dojo.telerik.com/UsUwIXup

Regards,
Ianko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Grant
Top achievements
Rank 2
Veteran
Iron
answered on 27 Sep 2019, 02:45 PM

Thanks Ianko, 

This worked great. As a follow up, why does the binding have to happen before the Window initialization? Why cant I do it after, isnt the kendoWindow.element content the same as the initial element being bound? Does the Window initialization somehow change the initial element so the binding fails?

Thanks,
Grant

0
Ianko
Telerik team
answered on 27 Sep 2019, 03:15 PM

Hi Grant, 

The template mechanism is used internally as well over the content. And I assume, during the open event is already bound to the model. Therefore, any other binding will be avoided. This is why having the binding initially will cancel the internal binding of the content template.

Regards,
Ianko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
MVVM
Asked by
Grant
Top achievements
Rank 2
Veteran
Iron
Answers by
Ianko
Telerik team
Grant
Top achievements
Rank 2
Veteran
Iron
Share this question
or