rowData for retrieving id from a row won't work
- Ngôn ngữ chính
- TypeScript
- Star
- 1.6k
- Fork
- 867
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi, here's my code:
ListComponent.ts
```
settings = {
columns: {
id: {
title: 'ID'
},
username: {
title: 'Username'
},
firstName: {
title: 'firstName'
},
middleName: {
title: 'middleName'
},
lastName: {
title: 'lastName'
},
parent: {
title: 'parent'
},
balance: {
title: 'balance',
valuePrepareFunction: (cell,row) => 0, //Passed value for testing component functionalities
type: 'custom',
renderComponent: BalanceComponent
},
address: {
title: 'address'
},
comune: {
title: 'comune'
},
provincia: {
title: 'provincia'
},
cap: {
title: 'cap'
},
},
```
RenderComponent.ts
```
export class BalanceComponent implements OnInit {
@Input() rowData: any;
invoicesCounter: number
isPositive: boolean = false;
constructor(private authHttp: AuthHttpService) { }
ngOnInit() {
console.log(this.rowData);
this.authHttp.getBalance(this.rowData.id).subscribe(data => this.balance = data);
if(this.balance == 0){
this.isPositive = true;
}
}
}
```
Using
`@Input() value: number ` works perfectly
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.