2016-11-24 84 views
1

我一直在玩了一段時間,劍道的UI角度分量 和我創造了這個plunker:劍道的UI angular2 detailrow寬度,html和自動擴展

http://plnkr.co/edit/zrr3nlxQl7uxbdtH4oEA?p=preview

對於設置的寬度細節行我已經實現CSS:

.detailRow{ 
    display: inline-block; 
    word-wrap: break-word; 
    word-break: break-all; 
    max-width: 100px; 
    white-space: normal; 
} 

和HTML:

<template kendoDetailTemplate let-dataItem> 
     <section *ngIf="dataItem.Category"> 
     <article ><div class='detailRow'>{{dataItem.Category?.Description}}</div></article> 
     </section> 
    </template> 
  1. 這是控制細節寬度的方法嗎?

  2. 是否有可能在detailrow中顯示html(顯示粗體和斜體)?

  3. 是否有可能在加載時自動展開每一行?

回答

2
  1. 是的,在細節行內容使用width是細用於控制其寬度。
  2. 如果Category.Description字段包含HTML,則可能需要使用innerHTML綁定將其綁定爲shown in this thread。請務必清理HTML,否則可能會出現XSS攻擊。
  3. 目前沒有提供控制所有明細行的方法。這已記錄並可追蹤in the feature request in the kendo-angular2 repo
+0

謝謝Alex。也用於將其添加到存儲庫。 –