DmitrMakeev commited on
Commit
8271e4d
·
verified ·
1 Parent(s): dc31e57

Update data_gc_tab.html

Browse files
Files changed (1) hide show
  1. data_gc_tab.html +5 -4
data_gc_tab.html CHANGED
@@ -270,11 +270,12 @@ document.getElementById("download-csv").addEventListener("click", function(){
270
  table.download("csv", "data.csv");
271
  });
272
 
273
- //trigger download of data.json file
274
- document.getElementById("download-json").addEventListener("click", function(){
275
- table.download("json", "data.json");
 
 
276
  });
277
-
278
  //trigger download of data.xlsx file
279
  document.getElementById("download-xlsx").addEventListener("click", function(){
280
  table.download("xlsx", "data.xlsx", {sheetName:"My Data"});
 
270
  table.download("csv", "data.csv");
271
  });
272
 
273
+ // Handle button click for displaying filtered JSON in console
274
+ document.getElementById("download-json").addEventListener("click", function() {
275
+ var tableData = table.getData("active"); // Получаем данные только для отображаемых строк
276
+ var jsonData = JSON.stringify(tableData, null, 2); // Преобразуем данные в JSON-строку
277
+ console.log(jsonData); // Выводим JSON-строку в консоль
278
  });
 
279
  //trigger download of data.xlsx file
280
  document.getElementById("download-xlsx").addEventListener("click", function(){
281
  table.download("xlsx", "data.xlsx", {sheetName:"My Data"});