我们需要具有带有日历的可编辑网格模板列,我正在使用以下代码,但它在运行时返回错误。我认为错误发生在下面突出显示的行。
错误:未捕获(承诺):位置 2 出现意外文字
<div class="content">
<div class="form-section">
<form *ngIf="checklistForm" class="form" [formGroup]="checklistForm" novalidate>
<p-growl [(value)]="successMessage"></p-growl>
<div class="alert alert-danger" role="alert" *ngIf="errorMessage">
<span>{{ errorMessage }}</span>
</div>
<userTracking [isChanged]="isChanged">
</userTracking>
<p-dataTable [value]="lstchecklistModel" [responsive]="true" rowGroupMode="subheader" groupField="groupdesc" [editable]="true" [style]="{'margin-top':'10px'}">
<ng-template pTemplate="rowgroupheader" let-rowData>{{rowData['groupdesc']}}</ng-template>
<p-column field="labelName" header="Checklist" [style]="{'overflow':'visible', 'width':'300px'}"></p-column>
<p-column field="required" header="Required?" [editable]="true" [style]="{'overflow':'visible', 'width':'100px'}">
<ng-template let-col let-row="rowData" let-i="rowIndex" pTemplate="editor">
<p-dropdown [(ngModel)]="row[col.field]" (onChange)="OnRequiredChange(row);" [ngModelOptions]="{standalone: true}" [options]="RequiredValues" [autoWidth]="false" [style]="{'width':'100%'}"></p-dropdown>
</ng-template>
</p-column>
<p-column field="received" header="Recived?" [editable]="true" [style]="{'overflow':'visible', 'width':'100px'}">
<ng-template let-col let-row="rowData" pTemplate="editor">
<p-dropdown [(ngModel)]="row[col.field]" [ngModelOptions]="{standalone: true}" (onChange)="OnRecievedChange(row);" [options]="RequiredValues" [autoWidth]="false" [style]="{'width':'100%'}"></p-dropdown>
</ng-template>
</p-column>
<p-column field="receivedDate" header="Received Date">
<ng-template let-col let-row="rowData" pTemplate="body">
{{row[col.field] }}
</ng-template>
</p-column>
**<p-column field="mailReceivedDate" header="Mail Received Date" [editable]="true" [style]="{'overflow':'visible'}">
<ng-template let-col let-row="rowData" pTemplate="body">
{{row[col.field] }}
</ng-template>
<ng-template let-col let-row="rowData" pTemplate="editor">
<p-calendar [(ngModel)]="row[col.field]" [ngModelOptions]="{standalone: true}" [locale]="en" ></p-calendar>
</ng-template>
</p-column>**
<p-column field="updatedBy" header="Updated By"></p-column>
</p-dataTable>
<footer class="pager">
<div class="button-group">
<button class="btn btn-primary btn-sm" (click)="saveChecklist();" [disabled]="!checklistForm.valid">Save</button>
<button class="btn btn-primary btn-sm" (click)="SaveandContinue();" [disabled]="!checklistForm.valid">Save & Continue</button>
<button class="btn btn-secondary btn-sm" type="reset" (click)="loadData();" formnovalidate>Cancel</button>
</div>
</footer>
</form>
</div>
</div>