Cannot bind Model to View inside a KendoWindow

4 posts, 1 answers
  1. Grant
    Grant avatar
    179 posts
    Member since:
    Jul 2016

    Posted 25 Sep 2019 Link to this post

    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

  2. Answer
    Ianko
    Admin
    Ianko avatar
    1956 posts

    Posted 27 Sep 2019 Link to this post

    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.
  3. Grant
    Grant avatar
    179 posts
    Member since:
    Jul 2016

    Posted 27 Sep 2019 in reply to Ianko Link to this post

    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

  4. Ianko
    Admin
    Ianko avatar
    1956 posts

    Posted 27 Sep 2019 Link to this post

    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.
Back to Top