javascript - Ag-Grid:无法读取属性 0
问题描述
我收到Uncaught TypeError: Cannot read property '0' of undefined尝试将 ag-grid 数据导出到 Excel 中。任何想法可能是什么原因。它在镀铬线上有喙@_gridOptions.api.getDataAsExce
。
_exportDataAsExcel: ->
content = @_gridOptions.api.getDataAsExcel({allColumns: false, exportMode: "xml", suppressTextAsCDATA: true})
workbook = XLSX.read(content, type: 'binary')
xlsxContent = XLSX.write(workbook, bookType: 'xlsx', type: 'base64')
@_downloadXLSX(xlsxContent)
_downloadXLSX: (base64content) ->
fileName = 'export.xlsx'
blobObject = @_base64toBlob(
base64content,
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
)
解决方案
推荐阅读
- python - 如何将某些值移动到另一列以获取后面的所有值
- java - 将项目迁移到 Maven 后 ImageIcon 上的 NullPointer
- sql - 查找包含集合的记录
- node.js - 提供 json 文件时出现意外的令牌
- iis - ASP Web Api 突然无数据返回
- jquery - 如何使用Javascript匹配不同数组中的字符串
- java - 当构造函数中的局部变量和实例变量相同时,调用 clone() 是一个不错的选择
- javascript - 建立一个像素艺术制造商
- python - 根据多个条件比较数据帧的一行
- c# - Twilio,您如何处理会议中的 maxParticipants?