如何在Angular-4中的ng2表中添加复选框?
我需要在Angular 4 typescript中添加复选框,我们正在使用ng2表如何在Angular-4中的ng2表中添加复选框?,angular,typescript,checkbox,ng2-smart-table,Angular,Typescript,Checkbox,Ng2 Smart Table,我需要在Angular 4 typescript中添加复选框,我们正在使用ng2表 //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 ht
//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
....
}
//html中ng表的代码
//为了创建复选框,我在填充数据的组件中添加了html。
data.forEach((项目:任何)=>
{item.CheckBox='';
//正在触发表组件中的单元格单击事件
public onCellClick(数据:任意):任意{
此事件正在被触发
....
}
请帮助。谢谢。您的数据绑定到表中的位置在哪里?复选框的模板在哪里?您可以在回购中重新创建问题吗
顺便说一句,感谢您的回复,中有一个关于复选框的线程。它不是常规的复选框。它包含在ng2表中。我可以触发单元格单击事件。但是,该复选框在UI中被禁用。还可以查看您提供的链接。您能提供一个“请”吗?例如,我已经编辑了我的问题并添加了more详细信息。如果您能提供帮助。谢谢。谢谢您的回复。问题已经解决。在cellClick事件中,我们能够添加动态基本html代码。这已经解决了问题。