2014-09-10 82 views
0

我正在使用Kendo UI MVC Asp.net tooltip控件顯示格式化數據。但是,工具提示並不顯示數據和格式,而是顯示HTML代碼。Kendo UI Tooltip問題

tootip image

使用下面的代碼段,以顯示工具提示

TollTip( '#日曆表TBODY', 「#timeTemplate」, 'TD a.aCurrent', 「頂部」);

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

你試過了什麼?你期望會發生什麼?什麼,或沒有發生?除此之外,'TollTip'與'ToolTip'也許? 'kendo.Template'也不會返回'kendo.Template'對象而不是HTML字符串。 – Mardoxx 2014-09-10 14:12:19

+0

工具提示顯示我的HTML代碼而不是格式文本 – 2014-09-10 14:15:54

回答

1
function TollTip(target, template, filter, position) { 
    $(target).kendoTooltip({ 
     filter: filter, 
     content: function(e) { kendo.template($(template).html())(e) } , 
     position: position 
    }); 
} 
+0

我必須在您的代碼片段中編輯什麼?它向我展示空白的工具提示。 – 2014-09-10 14:22:39