我无法在angular4 Screenshot of grid中添加kendo-grid中的按钮 还有其他方法可以添加按钮吗?
<kendo-grid
[data]="view | async"
[pageSize]="state.take"
[skip]="state.skip"
[sort]="state.sort"
[sortable]="true"
[pageable]="true"
[scrollable]="'none'"
[filterable]="false"
(dataStateChange)="dataStateChange($event)"
>
<kendo-grid-column field="Discontinued" width="120">
<button kendoButton >Default</button>
</kendo-grid-column>
<kendo-grid-column field="name" title="NAME" width="200"></kendo-grid-column>
<kendo-grid-column field="wef" title="WEF" width="200"></kendo-grid-column>
</kendo-grid>
答案 0 :(得分:1)
要在单元格中显示按钮(或任何其他自定义内容),您需要将ng-template
与kendoGridCellTemplate
指令嵌套在kendo-grid-column
中。 (Documentation)
示例:(Plunker)
<kendo-grid
...
>
<kendo-grid-column field="Discontinued" width="120">
<ng-template kendoGridCellTemplate>
<button kendoButton>Default</button>
</ng-template>
</kendo-grid-column>
...
</kendo-grid>