当CellEditor失去焦点时,我想打电话给this.params.api.stopEditing();
。
app.component.ts
onFocusOut(): void {
this.params.api.stopEditing();
}
app.component.html
<input #container triggers="" type="text" #dp="bsDatepicker" class="form-control" (bsValueChange)="onValueChange($event)" bsDatepicker
[bsConfig]="{ dateInputFormat: 'DD.MM.YYYY', containerClass: 'theme-dark-blue' }"
[(ngModel)]="dateValue"
[minDate]="minDate"
[maxDate]="maxDate"
(focusOut)="onFocusOut()">
但是没有触发focusOut。知道为什么不触发吗?
答案 0 :(得分:1)
不是(focusOut)
,而是(focusout)
。以此更新您的标记并进行验证。
有关更多参考,请查看此帖子的答案:HTML5 event handling(onfocus and onfocusout) using angular 2