JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://warpech.github.com/jquery-handsontable/jquery.handsontable.js"></script>
<script src="http://warpech.github.com/jquery-handsontable/lib/bootstrap-typeahead.js"></script>
<script src="http://warpech.github.com/jquery-handsontable/lib/jQuery-contextMenu/jquery.contextMenu.js"></script>
<link rel="stylesheet" href="http://warpech.github.com/jquery-handsontable/lib/jQuery-contextMenu/jquery.contextMenu.css">
<link rel="stylesheet" href="http://warpech.github.com/jquery-handsontable/jquery.handsontable.css">
<div id="example9container" class="example">
<div class="pad">
<h3>MultiRow Upload</h3>
<div id="example9grid" class="dataTable"></div>
<p>Callback console: <span class="code">[[row, col, oldValue, newValue], ...]</span></p>
<pre id="example9console" class="console">Edit the above grid to see callback</pre>
</div>
</div>
</div>
<button id="btnGo">Load</button>
<P>
<textarea style="width: 200px; height: 200px;" class="handsontableInput" id="simple"></textarea>
JavaScript
var first = true;
$("#example9grid").handsontable({
rows: 8,
cols: 8,
minSpareCols: 1,
minSpareRows: 1,
contextMenu: true,
onChange: function(data) {
if (first) {
first = false;
return;
}
console.log(JSON.stringify(data));
$("#example9console").text(JSON.stringify(data));
}
});
var data = [
["", "Kia", "Nissan", "Toyota", "Honda"],
["2008", 10, 11, 12, 13],
["2009", 20, 11, 14, 13],
["2010", 30, 15, 12, 13]
];
$("#example9grid").handsontable("loadData", data);
$('#btnGo').click(function() {
var rowList = new Array();
$("table tr").each(function() {
var colList = new Array();
$("td", this).each(function() {
colList.push($(this).text());
});
rowList.push(colList);
//console.log(colList);
});
$('#simple').val(JSON.stringify(rowList));
console.log(rowList);
//console.log($('table tr').find('td').each());
});