Exception when calling "render" on a View

4 posts, 0 answers
  1. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 04 Mar 2013 Link to this post

    If the view does not start with an opening bracket, an exception is thrown. For example try the following.
    var view = new kendo.View(" <p>hey ho</p>");
    view.render("#app");
    Please regard the space character in front of the "p" element.

    Michael G. Schneider
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 05 Mar 2013 Link to this post

    Hello Michael,

    This behavior is related to a recent jQuery update (as the string can contain both selectors and html string). 

    While the view can trim the input, I do not think that we should apply that performance penalty to every view instantiation - if you expect whitespace in the html string, you can trim the contents manually. 

    Greetings,
    Petyo
    the Telerik team
    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
  4. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 05 Mar 2013 Link to this post

    Hello Petyo,

    thanks a lot for the explanation.

    I did not know this change in jQuery. Moreover, if such an exception is thrown, I do not debug into Kendo and then into jQuery for finding the exact location of the problem. So I do not know, what is called in response to a "kendo.View" call.

    Maybe you should insert a hint into the Kendo documentation, describing this potential problem.

    Michael G. Schneider
  5. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 07 Mar 2013 Link to this post

    Hello Michael, 

    Thank you for your feedback. We will consider explaining the behavior in further details in the documentation. 

    Kind regards,
    Petyo
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready