Posted 30 November 2017, 4:54 am EST
I have a Flexgrid with 8 columns. There are 1 dropdown mapping to a column 1, 2 wij-input-date mapping to column 2 & 3, and a button on column 7
How can I set the entire row to be readOnly when toDate is less than today date? which will not let user edit any cell on the row, dropdown will be disabled, input date is also disabled. Thank you very much
<wj-flex-grid
#flexLoans
[allowAddNew]="true"
[allowDelete]="true"
[selectionMode]="3"
[autoGenerateColumns]="false"
[headersVisibility]="1"
[itemsSource]="selectedLoans"
(cellEditEnded)="loansChanged($event)"
(deletedRow)="deleteLoanRow($event,flexLoans)"
>
<wj-flex-grid-column
[binding]="'teamMemberLoanId'"
[visible]="false"
>
</wj-flex-grid-column>
<wj-flex-grid-column
[dataMap]="loansMap"
[showDropDown]="toDate >= minDate || toDate === null"
[header]="'Loan to Business Unit'"
[binding]="'businessUnitID'"
[width]="'150*'"
>
</wj-flex-grid-column>
<wj-flex-grid-column
[header]="'From Date'"
[binding]="'fromDate'"
[width]="'50*'"
[format]="'MM/dd/yyyy'"
[inputType]="date"
>
<ng-template wjFlexGridCellTemplate
[cellType]="'Cell'"
let-cell="cell">
<wj-input-date
[min]="minDate"
[(value)]="cell.item.fromDate"
[min]="cell.item.fromDate ? cell.item.fromDate : minDate"
[mask]="'00/00/0000'"
[isRequired]="false"
(valueChanged)="updateFromDate(cell.item)">
</wj-input-date>
</ng-template>
</wj-flex-grid-column>
<wj-flex-grid-column
[header]="'To Date'"
[binding]="'toDate'"
[width]="'50*'"
[format]="'MM/dd/yyyy'"
[inputType]="date"
>
<ng-template wjFlexGridCellTemplate
[cellType]="'Cell'"
let-cell="cell">
<wj-input-date
[min]="minDate"
[(value)]="cell.item.toDate"
[min]="cell.item.fromDate ? cell.item.fromDate : minDate"
[mask]="'00/00/0000'"
[isRequired]="false">
</wj-input-date>
</ng-template>
</wj-flex-grid-column>
<wj-flex-grid-column
[header]="'Comments'"
[binding]="'comments'"
[width]="'200*'"
>
</wj-flex-grid-column>
<wj-flex-grid-column
[header]="'Delete'"
[allowSorting]="false"
[width]="75"
[align]="'center'"
[isReadOnly]="true"
>
<ng-template wjFlexGridCellTemplate [cellType]="'Cell'" let-item="item">
<button
ion-button icon-only clear small
[disabled]="item.toDate < minDate"
(click)="removeLoan($event, item.teamMemberLoanId, flexLoans)">
<ion-icon name="trash"></ion-icon>
</button>
</ng-template>
</wj-flex-grid-column>
</wj-flex-grid>