【发布时间】:2021-03-01 20:11:25
【问题描述】:
使用下面的代码时,我收到错误“错误:给 addRows 的参数必须是数字或数组”。但是,当我复制正在导出的代码并对其进行硬编码时,数据会正确显示。有人有什么想法吗?
硬编码版本是这样的:
dataTable.addRows([
['DTR V', null, 'Approval Audience Generation Invitation and Confirmation', new Date(2021, 3, 13), new Date(2021, 5, 15) ],
]);
for(var i = 2; i < countRow; i++) {
for(var ii = 0; ii < countColumn; ii++) {
if (ii == 0) {
theData += "[ '" + a.getDataTable().getValue(i, 0) + "', null, '<div class=\"ggl-tooltip\">" + a.getDataTable().getValue(i, 2) + "</div>', new Date("+ a.getDataTable().getFormattedValue(i, 3) +"), new Date("+ a.getDataTable().getFormattedValue(i, 4) +") ], ";
}
}
dataTable.addRows(theData);
}
【问题讨论】: