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

Exception when calling "render" on a View

3 Answers 49 Views
SPA
This is a migrated thread and some comments may be shown as answers.
mgs
Top achievements
Rank 1
mgs asked on 04 Mar 2013, 09:05 AM
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

Sort by
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!
0
mgs
Top achievements
Rank 1
answered on 05 Mar 2013, 02:05 PM
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
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!
Tags
SPA
Asked by
mgs
Top achievements
Rank 1
Answers by
Petyo
Telerik team
mgs
Top achievements
Rank 1
Share this question
or