<script src="https://jspreadsheet.com/v9/jspreadsheet.js"></script>
<link rel="stylesheet" href="https://jspreadsheet.com/v9/jspreadsheet.css" type="text/css" />
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<h1>Data grid cloning</h1>
<div id="spreadsheet"></div>
<div id="spreadsheet-clone"></div><br>
<textarea id="console" style="width: 600px; height: 100px;"></textarea><br>
<input type="button" value="Get config and clone data grid" onclick="clone()" class="button main" />
<p><a href="https://jspreadsheet.com/v9/docs/config">Data grid</a> config cloning</p>
<script>
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('Yjk2YWVjN2VhZjAwZWI2ZDg1YTgzNTVhODY1ZGE3NWUwYWE5MjNiMjU5MTE1ZjY2MzMxNTYxYWI2M2NjNWY4NjA3M2I0ZmQ2NWUwZTZkYjlmNzAxNjJhOTU5MTQ3YmRiYzkwYTNiOWM3N2RhNDFmNWEzMGNiOGYwYTc2YjI5YmQsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UWTNNREV5TWpnd05Td2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpJaXdpYzJOdmNHVWlPbHNpZGpjaUxDSjJPQ0lzSW5ZNUlpd2lZMmhoY25Seklpd2labTl5YlhNaUxDSm1iM0p0ZFd4aElpd2ljR0Z5YzJWeUlpd2ljbVZ1WkdWeUlpd2lZMjl0YldWdWRITWlMQ0pwYlhCdmNuUWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0pkTENKa1pXMXZJanAwY25WbGZRPT0=');
var clone = function() {
// Get the data grid configuration
var config = grid[0].parent.getConfig();
// Show on the textarea
document.getElementById('console').value = JSON.stringify(config);
// Destroy any existing spreadsheet
jspreadsheet.destroy(document.getElementById('spreadsheet-clone'));
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet-clone'), config);
}
// Create the JavaScript sample data grid
var...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.