2012-09-23 147 views
0

我正在使用JQuery模板在asp.net中創建表格網格。但是我得到了渲染問題。下面的代碼:JQuery模板呈現問題

<script id="housingTemplate" type="text/x-jquery-tmpl"> 
    <div class="oddrow togglestyle"> 
     <div class="oddFirst"> 
      ${ID} 
     </div> 
     <div class="oddFirst thirdWidth fourthWidth info-tooltip" 
      title="{{ html ProjectName }}"> 
      ${ProjectName} 
     </div> 
     <div class="oddFirst thirdWidth fourthWidth info-tooltip" 
      title="Ravi Joshi"> 
      ${Address} 
     </div> 
     <div class="oddFirst thirdWidth info-tooltip"> 
      ${ZipCode} 
     </div> 
     <div class="oddFirst thirdWidth info-tooltip"> 
      ${City} 
     </div> 
     <div class="oddFirst thirdWidth info-tooltip"> 
      ${Type} 
     </div> 
    </div> 
<script> 

$("#businessTemplate").tmpl($.parseJSON(data.ResponseData)).appendTo("#dataList"); 

「稱號」 DIV的標籤不呈現回場內「#dataList」,jQuery的模板跳過這一部分,使所有的休息。

因爲插件僅支持在「標題」標籤內寫入的文本,所以我希望DIV上的「title」標籤用於TOOLTIP目的。

是否有什麼我在代碼中寫錯了?

+1

嘗試取出空間'標題= 「{{HTML項目名}}」' –

回答

1

您是否嘗試過刪除多餘的內部空間:

{{html ProjectName}} 

相反的:

{{ html ProjectName }} 

{{html fieldNameOrExpression}}文檔頁面上的語法沒有任何內部空間。

http://api.jquery.com/template-tag-html/