I want to get the values from handsontable but i am getting this error: Uncaught ReferenceError: hot is not defined
I don't know why i am getting this error as i have defined hot .
here is my js code
<body>
<div id='table_set' style='margin-left:150px;'>
<button id='save'>Save</button>
<div class='handsontable' id='create_table'></div>
</div>
</body>
<script>
$(document).ready(function () {
var data = [[]];
var container = document.getElementById('create_table');
var hot = new Handsontable(container,
{
data: data,
minRows: 30,
minCols: 13,
maxRows:100,
copyPaste:true,
colHeaders: true,
rowHeaders: true,
rowHeaders: true,
contextMenu: true,
dropdown: true,
colHeaders:["Testcase Name","Cell Name","Customer","Flops","Title","Status","Mfix CCR(open/close)","Scenerio-Brief Description","Expected Results","CCR Status","CCR No.","Remarks","Testcase Path"]
});
});
$(document).ready(function () {
$('#save').click(function() {
var pr= hot.getData();
alert(pr);
});
});
I want to get the values i have written in the table , in the alert box whenever i hit the save button.Please help, where i am missing.
Thanks in advance.