UNPKG

@adaptabletools/adaptable

Version:

Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

18 lines (17 loc) 632 B
import Helper from '../../Utilities/Helpers/Helper'; export const handleExportState = (type, name, state, api) => { switch (type) { case 'Clipboard': let stringifiedState = JSON.stringify(state); Helper.copyToClipboard(stringifiedState); break; case 'Console': api.consoleLog('Adaptable state:', state); break; case 'JSON': const jsonFileName = name + '.json'; const jsonContent = JSON.stringify(state); Helper.createDownloadedFile(jsonContent, jsonFileName, 'application/json'); break; } };