Reputation: 43
Basically in the typescript file, I have a function which pushes the data into an array
So I passed in input type="checkbox" to one of the values but apparently the checkbox isn't working as it cannot be clicked or ticked
I have tried toggling the checkbox but to no avail.
// Array to store data
public col: Array<any> = [
{ title : 'Select', name: 'select'},
....
...
];
//Function to push
this.data.push({
"select": '<input type = "checkbox" slotId = "'+bk.slotID+'"/>',
........
........
//in html
<div class = "row">
<ng-table #listTble [config]="config" #ngTable="ng-table" [rows]="data" [columns]="columns">
The check box is displayed, but cannot be ticked, Also on a side note i am fresh on angular but tasked to work on this angular project so I am kind of lost any insights will be valuable!
Upvotes: 1
Views: 676
Reputation: 43
What i did was manually pushing in a fixed Checkbox, thus it will not be able to be checked.
Also, found out that the data was displayed using a ng-table template called from ngtable.component. Thus I edited the code there to include a checkbox and its solved!
Upvotes: 0
Reputation: 5530
You can follow the example in stackblitz using formarray.
You can add createNew() function to your checkbox in your form. you have to wrap it within a table in own way.
Upvotes: 1