我正在使用 Tabulator 来管理一些表格,我已经了解了如何以 JSON 格式下载文件和其他格式,但我想知道是否包含将数据保存在 JSON 对象中的函数,以便我可以将其直接上传到服务器
我已经检查了这个页面http://tabulator.info/docs/4.1/download并且我想到了使用“自定义文件格式化程序”然后拦截下载 bolb 但我一直收到一个错误指
setFileContents(names.join(", "), "text/plain");
Uncaught ReferenceError: setFileContents is not defined
功能代码:
document.querySelector("#uploadJSON").onclick = function(){
var fileFormatter = function(columns, data, options){
var names = [];
data.forEach(function(row){
names.push(row.name);
});
setFileContents(names.join(", "), "text/plain");
}
table.download(fileFormatter, "test.json");
}