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
3 Answers, 1 is accepted
0
Petyo
Telerik team
answered on 05 Mar 2013, 10:01 AM
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!
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
0
Petyo
Telerik team
answered on 07 Mar 2013, 09:35 AM
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!