MVVM View, evalTemplate

2 posts, 0 answers
  1. Carsten Koster
    Carsten Koster avatar
    25 posts
    Member since:
    Sep 2006

    Posted 04 Dec 2014 Link to this post

    Hey just a quick thing,

    I tried to use a kendo.View fed by html containing kendo-template expressions:
       
     var viewModel = kendo.observable({       
            test: '123'
     }); 
    var
    myFailedView = new kendo.View('<span data-bind="text: test"></span> #: location.href #', { model:viewModel, evalTemplate: true });

    var mySucessfulView = new kendo.View('##<span data-bind="text: test"></span> #: location.href #', { model:viewModel, evalTemplate: true });

    I would expect it to render  a span with 123 followed by the current location of the browser. But it only renders the span. If I start with an empty template expression "##" it behaves as expected. Is that a bug or did I miss something in the documentation?

    For reference see JsFiddle

    Regards,
    Kris


    http://jsfiddle.net/9y36opsk/

  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 05 Dec 2014 Link to this post

    Hello Carsten,

    Thank you for the reproduction. This is a known issue, but due to its relatively limited usage we have not investigated it further. The evalTemplate will work as expected if the view is created from a script template. Our API reference shows this approach

    I will log the problem in our GitHub repository, we will try to address it shortly. 
     
    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top