我正在调用一个返回Promise.all的函数。
applyFilterToSh = (sheet, name, value)=>{
return sheet.applyFilterAsync(name, value, tableau.FilterUpdateType.REPLACE);
}
applyFilterToSheets = (name, value) => {
let sheets = this.getActiveSheet().getWorksheets();
return Promise.all(sheets.map((sheet)=>{
return this.applyFilterToSh(sheet, name, value);
}))
}
setDefaultFilters(){
this.applyFilterToSheets(filterValues[0].name, filterValues[0].values[0].formattedValue).then((s)=>{
this.gFilters.setIsDashboardLoading(false);
this.gFilters.setAllFilters(this.currentFiltersList);
})
}
仅当我打开浏览器控制台或关闭它时,才会触发成功回调。