i have a ts file like this:
export class ListComponent implements OnInit {
rows: any;
columns = [
{ prop: 'name' },
{ name: 'Gender' },
{ name: 'Company' },
{ name: 'price' }
];
constructor(
private productService: ProductService,
) { }
ngOnInit() {
const v = this.productService.getProduct();
this.rows = v;
}
}
that productService.getProduct() return an array of Product.
and html file like this:
<div>
<ngx-datatable class="material" [rows]="rows" [columns]="columns">
</ngx-datatable>
</div>
so i want to add two cell for example Commission and FinalPrice that Commission cell will have an number input and FinalPrice be read only cell. if user change value of Commission input, FinalPrice change based on (rows.price - Commission). this functionality must be for each row independently.
please do me a favor to solve problem.