Spaces:
Sleeping
Sleeping
Update data_gc_tab.html
Browse files- data_gc_tab.html +32 -26
data_gc_tab.html
CHANGED
@@ -162,9 +162,11 @@
|
|
162 |
|
163 |
<button id="filter-clear">Очистить фильтр</button>
|
164 |
|
165 |
-
|
166 |
-
|
167 |
-
|
|
|
|
|
168 |
</div>
|
169 |
<div id="example-table"></div>
|
170 |
|
@@ -262,29 +264,33 @@
|
|
262 |
valueEl.value = "";
|
263 |
table.clearFilter();
|
264 |
});
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
|
|
|
|
|
|
|
|
288 |
})
|
289 |
.catch(error => console.error('Error fetching data:', error));
|
290 |
});
|
|
|
162 |
|
163 |
<button id="filter-clear">Очистить фильтр</button>
|
164 |
|
165 |
+
<button id="download-csv">Download CSV</button>
|
166 |
+
<button id="download-json">Download JSON</button>
|
167 |
+
<button id="download-xlsx">Download XLSX</button>
|
168 |
+
<button id="download-pdf">Download PDF</button>
|
169 |
+
<button id="download-html">Download HTML</button>
|
170 |
</div>
|
171 |
<div id="example-table"></div>
|
172 |
|
|
|
264 |
valueEl.value = "";
|
265 |
table.clearFilter();
|
266 |
});
|
267 |
+
//trigger download of data.csv file
|
268 |
+
document.getElementById("download-csv").addEventListener("click", function(){
|
269 |
+
table.download("csv", "data.csv");
|
270 |
+
});
|
271 |
+
|
272 |
+
//trigger download of data.json file
|
273 |
+
document.getElementById("download-json").addEventListener("click", function(){
|
274 |
+
table.download("json", "data.json");
|
275 |
+
});
|
276 |
+
|
277 |
+
//trigger download of data.xlsx file
|
278 |
+
document.getElementById("download-xlsx").addEventListener("click", function(){
|
279 |
+
table.download("xlsx", "data.xlsx", {sheetName:"My Data"});
|
280 |
+
});
|
281 |
+
|
282 |
+
//trigger download of data.pdf file
|
283 |
+
document.getElementById("download-pdf").addEventListener("click", function(){
|
284 |
+
table.download("pdf", "data.pdf", {
|
285 |
+
orientation:"portrait", //set page orientation to portrait
|
286 |
+
title:"Example Report", //add title to report
|
287 |
+
});
|
288 |
+
});
|
289 |
+
|
290 |
+
//trigger download of data.html file
|
291 |
+
document.getElementById("download-html").addEventListener("click", function(){
|
292 |
+
table.download("html", "data.html", {style:true});
|
293 |
+
});
|
294 |
})
|
295 |
.catch(error => console.error('Error fetching data:', error));
|
296 |
});
|