我在 Kendo UI 中有一个 Grid 模板,如下所示:
<script id="rowTemplate" type="text/x-kendo-tmpl">
<tr class="row-template">
<td style="width:80px">
<div rowspan="4"><img src="../../Images/picture_temp.jpg" class="display_searchresults_picture"/></div>
</td>
<td>
<div class="display_searchresults_name"><a href="">#= FirstName # #= LastName # </a></div>
<div align="right" width="100px">* * * * *(4.5)</div>
# for (var i = 0; i < Education.length; i++) { #
<div class="display_searchresults_address">#= Address.City #, #= Address.State # | #= Education[i].School.Name #</div>
# for (var j = 0; j < Education[i].Major.length; j++) { #
<div class="display_searchresults_info">#= Education[i].Major[j].Name # | #= Education[i].GraduationDate.Year # | 3.5-3.75</div>
# } #
# } #
<div class="display_searchresults_desc" colspan="2">#= Description #<a href="">...</a></div>
</td>
</tr>
这个模板在 IE 9 中就像一个魅力,但在 Firefox 中它呈现为:
#= FirstName # #= LastName #
* * * * *(4.5)
# for (var i = 0; i < Education.length; i++) { #
#= Address.City #, #= Address.State # | #= Education[i].School.Name #
# for (var j = 0; j < Education[i].Major.length; j++) { #
#= Education[i].Major[j].Name # | #= Education[i].GraduationDate.Year # | 3.5-3.75
# } # # } #
#= Description #...
基本上,它呈现为代码,而不是 html。
至于 Chrome,网格根本不会在那里渲染。如何使 Kendo UI Grid 模板适用于其他浏览器?