【发布时间】:2020-04-16 21:54:52
【问题描述】:
这个功能是一个承诺
veryfyEdit()
this.gridApi.stopEditing()
this.gridApi.refreshCells() as Promise<any>
}
我在这里使用它并且返回未定义,但我需要知道如何使用这个网格 api 使其工作
openLancarDialog() {
this.veryfyEdit().then(() => {
if (this.validadeData()) {
const dialogRef = this._lancarDialog.open(LancarCdvDialogComponent, {
width: '50em',
//height: '40em',
disableClose: false,
data: {
tipoViagem: this.dadosCab.tipoViagem,
empresaViagem: this.dadosCab.codEmpresa,
centroCustoViagem: this.dadosCab.area,
numeroCDV: this.dadosCab.numeroCDV,
dtoToSave: this.dtoToSave
}
});
dialogRef.afterClosed().subscribe(result => {
if (result != null && result != undefined)
this.showNotification(result.typeMsg, result.resultMsg)
if ((result == undefined) || (result.typeMsg === 'success')) {
this.Accesst('ctrl-despesas-viagens', 'listar-cdv');
}
});
}
})
}
我如何让这个承诺生效?
【问题讨论】: