[This issue may also exist using other syntax, but I don't think so.]
Taking the following grid declaration as an example (some things have been removed for simplicity).
In this editHandler is the name of a function, and this works fine.
If IdTemplate is the name of a function, then that works fine. Alternately, a valid template string may be placed where IdTemplate is. However, it may not be the name of an element containing a template that can be processed by kendo.template. You also cannot use kendo.template($("#IdTemplate").html()), either (and this is documented here: http://www.telerik.com/forums/how-to-declaratively-set-mvvm-data-column-template-to-external-template- )
However, MessageTemplate apparently must be the name of an element (normally this object would be a script element) that contains the template that can be processed by kendo.template. It may not be a function name. You may not replace it with a valid template string. This appears to be a convenient shorthand from the function call syntax where one would normally have to do something like kendo.template($("#MessageTemplate").html())
Obviously, this is an inconsistency in the way templates are declared between the row detail template and the column template.. I am concerned if I develop code depending on one of these mechanisms, that it will be altered by a later version of Kendo UI.
Thoughts?
Taking the following grid declaration as an example (some things have been removed for simplicity).
<div id="userInfo" data-role="grid" data-columns='[{field:"FirstName", title: "First", width: "9%"}, {field:"LastName", title: "Last", width: "10%"}, {field:"UserId", title: "ID", width: "10%", template:IdTemplate } ]' data-edit="editHandler" data-detail-template='MessageTemplate'></div>In this editHandler is the name of a function, and this works fine.
If IdTemplate is the name of a function, then that works fine. Alternately, a valid template string may be placed where IdTemplate is. However, it may not be the name of an element containing a template that can be processed by kendo.template. You also cannot use kendo.template($("#IdTemplate").html()), either (and this is documented here: http://www.telerik.com/forums/how-to-declaratively-set-mvvm-data-column-template-to-external-template- )
However, MessageTemplate apparently must be the name of an element (normally this object would be a script element) that contains the template that can be processed by kendo.template. It may not be a function name. You may not replace it with a valid template string. This appears to be a convenient shorthand from the function call syntax where one would normally have to do something like kendo.template($("#MessageTemplate").html())
Obviously, this is an inconsistency in the way templates are declared between the row detail template and the column template.. I am concerned if I develop code depending on one of these mechanisms, that it will be altered by a later version of Kendo UI.
Thoughts?