我正在使用Kendo UI MVC Asp.net工具提示控件来显示格式化数据。但工具提示不是显示数据和格式,而是显示HTML代码。
使用以下代码段显示工具提示
TollTip(&#39; #calendar table tbody&#39;,&#34; #timeTemplate&#34;,&#39; td a.aCurrent&#39;,&#34; top&#34;); < / p>
function TollTip(target, template, filter, position) {
$(target).kendoTooltip({
filter: filter,
content: kendo.template($(template).html()),
position: position
});
}
在视图中,我使用了以下脚本代码段。
<script id="timeTemplate" type="text/x-kendo-template">
#if (target.data('title') != null) {#
<p>
#:target.data('title')#
</p>
#}#
</script>
我在代码中缺少什么?
答案 0 :(得分:1)
function TollTip(target, template, filter, position) {
$(target).kendoTooltip({
filter: filter,
content: function(e) { kendo.template($(template).html())(e) } ,
position: position
});
}