Set Date value to null via cell editor

Posted by: benjamin.runnels on 3 October 2017, 10:24 am EST

  • Posted 3 October 2017, 10:24 am EST

    I am unable to clear a Date value in a grid cell editor. I have no problem updating the value. I have isRequired set to false as suggested here:

    https://www.grapecity.com/en/forums/wijmo/clearing-the-value-inside_1_1_1

    Here's my column config:
    <wj-flex-grid-column [header]="'gatewayApp.module.purchaseDate' | translate" [binding]="'purchaseDate'" [width]="135" [data-type]="4" [format]="'yyyy-MM-dd'">
    <ng-template wjFlexGridCellTemplate [cellType]="'CellEdit'" let-cell="cell">
    <wj-input-date [(value)]="cell.value" [isRequired]="false" [format]="'yyyy-MM-dd'"></wj-input-date>
    </ng-template>
    </wj-flex-grid-column>
  • Replied 4 October 2017, 6:04 am EST

    Hi,
    You need to set isRequired to false before binding to value.


    Thanks,
    Manish Kumar Gupta
  • Replied 4 October 2017, 8:51 am EST

    Can you please provide an example?
  • Replied 5 October 2017, 6:52 am EST

    I'll answer my own. isRequired needs to be on both the column and the input

    <wj-flex-grid-column [header]="'gatewayApp.module.purchaseDate' | translate" [binding]="'purchaseDate'" [width]="135" [dataType]="4" [format]="'yyyy-MM-dd'"  [isRequired]="false">
    <ng-template wjFlexGridCellTemplate [cellType]="'CellEdit'" let-cell="cell">
    <wj-input-date [(value)]="cell.value" [isRequired]="false" [format]="'yyyy-MM-dd'"></wj-input-date>
    </ng-template>
    </wj-flex-grid-column>
  • Replied 9 October 2017, 2:46 am EST

    Hi Benjamin,
    We are sorry for the late reply and thank you for replying here.

    ~Manish Kr Gupta
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels