mazdik/ng-mazdik

Update/Filter column values

suryakanta101 opened this issue · 2 comments

@mazdik
Is there any way to update the column values based on Filter condition.
Example: Toggle Button to decide to Show the Column result either in Percentage or in Number.

Expectation

<ng-template #column4 let-row="row" let-value="value" let-column="column"> {{row.totalCount}} </ng-template>

On filter change "{{row.totalCount}}" need to replace by "{{row.Percentage}}"

Try something like this:

{{(condition) ? row.totalCount : row.Percentage}}

On filter change

    this.table.events.onRowsChanged();
    this.table.events.onResizeEnd(); // if columns change

this.table.events are not needed

    <ng-template #headerCellTemplate let-column="column">
      <span>{{column.title}}</span>
      <span (click)="state = !state" style="cursor: pointer; padding-left: 5px;">{{(state) ? '%': 'num'}}</span>
    </ng-template>
    <ng-template #cellTemplate let-row="row" let-value="value">
      {{(state) ? '100%' : value}}
    </ng-template>