Set Date value to null via cell editor

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

    • Post Options:
    • Link

    Posted 3 October 2017, 1: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>
    
  • Posted 3 October 2017, 9:04 pm EST

    Hi,

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

    Thanks,

    Manish Kumar Gupta

  • Posted 3 October 2017, 11:51 pm EST

    Can you please provide an example?

  • Posted 4 October 2017, 9:52 pm 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>
    
  • Posted 8 October 2017, 5:46 pm EST

    Hi Benjamin,

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

    ~Manish Kr Gupta

  • Posted 6 December 2017, 8:22 am EST

    How you will set the isrequired before binding any examples?

  • Posted 6 December 2017, 11:21 pm EST

    Hi Selva,

    Please refer to the plunker for the same.

    http://plnkr.co/edit/yvUKcjJ8SfhATxeS4DMm?p=preview

    ~Manish

Need extra support?

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

Learn More

Forum Channels