我已经阅读了
中的文档http://docs.telerik.com/kendo-ui/api/javascript/ui/spreadsheet#methods-insertSheet
但是在那个链接上我没有看到使用这个函数的例子。
有人可以给我一个insertSheet方法和removeSheet方法的例子吗?
感谢。
答案 0 :(得分:0)
dummy.get("/api/dummy/memberProfileStats", isAuthenticated, (req, res) => {
const userId = res.locals.user
const memberProfileStatsURL = `/api/reports/users/${userId}/general`
const memberLastLoginURL = `/api/users/${userId}/lastlogin`
// *** Start the requests in parallel
Promise.all([
getRequest(memberLastLoginURL)
.then(response => {
return response.data.result
}),
getRequest(memberProfileStatsURL)
.then(response => {
return {memberStats: response.data.result, httpStatusCode: response.data.httpStatusCode};
})
])
.then(([lastLoginTime, {memberStats, httpStatusCode}]) => {
// *** Both are done, send response
let pointsRank = [150, 500, 1000, 2000, 3500, 5000, 5500]
let totalPoints = memberStats.totalPoints
res.json({
data: {
totalPoints: memberStats.totalPoints,
totalPointsRedeemed: memberStats.totalPointsRedeemed,
availablePoints: (memberStats.totalPoints - memberStats.totalPointsRedeemed),
totalSessionTime: secondsToHm(memberStats.totalSessionTime), //convert sessionTime seconds to hours
loginsCount: memberStats.totalSessions,
rank: rank(totalPoints, pointsRank),
createdTime: memberStats.created,
lastLoginTime: lastLoginTime,
},
result: httpStatusCode
})
})
.catch(errorMessage => {
console.log( 'You'll want to update this error message: ' + errorMessage)
res.json(errorMessage)
})
})