static/js/datable.js
/**
 * Export data table as a JSON file (obsolete).
 * @function exportJSON
 * @param {Object} data - data object to export
 * @see {@link https://stackoverflow.com/questions/17527713/}
 * This way avoids saving the lengthy href.
 */
Export data table as a JSON file (obsolete).
Export data table as a JSON file ( obsolete ) .
function exportJSON(data) {
  const a = document.createElement('a');
  a.href = 'data:text/json;charset=utf-8,' +
    encodeURIComponent(JSON.stringify(data, null, 2));
  a.download = 'data.json';
  document.body.appendChild(a);
  a.click();
  document.body.removeChild(a);
}
function exportJSON ( data ) { const a = document . createElement ( 'a' ) ; a . href = 'data:text/json;charset=utf-8,' + encodeURIComponent ( JSON . stringify ( data , null , 2 ) ) ; a . download = 'data.json' ; document . body . appendChild ( a ) ; a . click ( ) ; document . body . removeChild ( a ) ; }
Export data table as a JSON file (obsolete).
Export data table as a JSON file ( obsolete ) .