通过 jQuery 下载 Tabulator table 的 xls
Downloading xls of Tabulator table via jQuery
根据http://tabulator.info/examples/4.6#download
有一个选项可以将 table 下载为 xlsx:
//trigger download of data.xlsx file
document.getElementById("download-xlsx").addEventListener("click", function(){
table.download("xlsx", "data.xlsx", {sheetName:"My Data"});
});
我正在尝试将其写在 jQuery 中(如 http://tabulator.info/docs/4.1/jquery)
$("#download-xlsx").click(function(){
$("#ovdim_list").tabulator.download("xlsx", "data.xlsx", {sheetName:"My Data"});
});
但是没用...
使用jQuery语法,正确的函数调用是:
$("#download-xlsx").click(function(){
$("#ovdim_list").tabulator("download", "xlsx", "data.xlsx", {sheetName:"My Data"});
});
当使用 jQuery 包装器时,函数名称进入 Tabulator 函数的第一个参数
根据http://tabulator.info/examples/4.6#download 有一个选项可以将 table 下载为 xlsx:
//trigger download of data.xlsx file
document.getElementById("download-xlsx").addEventListener("click", function(){
table.download("xlsx", "data.xlsx", {sheetName:"My Data"});
});
我正在尝试将其写在 jQuery 中(如 http://tabulator.info/docs/4.1/jquery)
$("#download-xlsx").click(function(){
$("#ovdim_list").tabulator.download("xlsx", "data.xlsx", {sheetName:"My Data"});
});
但是没用...
使用jQuery语法,正确的函数调用是:
$("#download-xlsx").click(function(){
$("#ovdim_list").tabulator("download", "xlsx", "data.xlsx", {sheetName:"My Data"});
});
当使用 jQuery 包装器时,函数名称进入 Tabulator 函数的第一个参数