【发布时间】:2018-10-05 07:33:37
【问题描述】:
我需要在我们使用 ng2-table 的 Angular 4 打字稿中添加复选框。
//code for ng-table in html
<ng-table (tableChanged)="onChangeTable(config)"
(cellClicked)="onCellClick($event)"
[rows]="rows" [columns]="columns">
</ng-table>
//to create checkbox I am adding html in component where filling the data.
data.forEach((item: any) =>
{item.CheckBox = '<input type="checkbox"></input>';
//cell click event in table component is getting triggered
public onCellClick(data: any): any {
this event is getting triggered
....
}
- UI 上的复选框已禁用或无法选中。 我认为某些事件被触发并将所选值恢复为 false 每一次。如何防止这种情况?
- 我在哪里将此复选框绑定到 ng-model 或类似的?
请帮忙。谢谢你。
【问题讨论】:
标签: angular typescript checkbox ng2-smart-table