Hi rsilva,
I would recommend you to take a look at this demo:
https://www.jqwidgets.com/angular/angular-grid/#https://www.jqwidgets.com/angular/angular-grid/angular-grid-computedcolumn.htm
And here are some modifications of the demo on how to achieve similar functionality:
//In your app.component.html file
<jqxGrid
[width]="getWidth()" [source]="dataAdapter" [columns]="columns"
[editable]="true" [selectionmode]="'multiplecellsadvanced'"
[columnsheight]="columnsheight"
[rowsheight]="rowsHeight"
>
</jqxGrid>
And in the app.component.ts file:
export class AppComponent {
columnsheight: any = 50
rowsHeight: any = 10
//rest of the code
Then in the cellsrenderer function in the ‘Total’ column:
{
text: 'Total', editable: false, datafield: 'total',
cellsrenderer: (index: number, datafield: string, value: any, defaultvalue: any, column: any, rowdata: any): string => {
let total = parseFloat(rowdata.price) * parseFloat(rowdata.quantity);
if(total < 15){
return '<div style="margin: 4px;" class="jqx-right-align">' + this.dataAdapter.formatNumber(total, 'c2') + '</div>';
}else {
this.rowsHeight = 50
return '<div style="margin: 4px;" class="jqx-right-align">' + this.dataAdapter.formatNumber(total, 'c2') + '<br> Cell value</div>';
}
}
}
Please, do not hesitate to contact us if you have any additional questions.
Best Regards,
Yavor Dashev
jQWidgets team
https://www.jqwidgets.com