I’m trying to post the data from handsontable to my controller. The table loads ok and works fine but nothing happens when I click the save button. I then did a F12 and saw an error:
Requested URL: /Scripts/jquery.min.map
After researching I fouind this link….. jquery 1.9.0 and modernizr cannot be minified with the ASP.NET Web Optimization Framework …… but it did not solve my problem. The action does ot get called and the error message is the same.
What could be the problem. Please help me to understand what’s going on. Thanks.
<script src="../../Scripts/jquery.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui.custom.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.handsontable.full.js" type="text/javascript"></script>
<script src="../../Scripts/numeral.sv-se.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.handsontable-excel.js" type="text/javascript"></script>
<link href="../../Content/themes/base/jquery-ui.custom.css" rel="stylesheet" type="text/css" />
<link href="../../Content/themes/base/jquery.handsontable.full.css" rel="stylesheet" type="text/css" />
<link href="../../Content/themes/base/demo-style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function () {
var $container = $("#dataGrid");
var $console = $("#dataConsole");
var $parent = $container.parent();
var autosaveNotification;
$container.handsontable({
startRows: 8,
startCols: 6,
rowHeaders: true,
colHeaders: true,
minSpareRows: 1
var handsontable = $container.data('handsontable');
$parent.find('button[name=save]').click(function () {
$.ajax({
url: "Controller/Action",
data: {"data": handsontable.getData()}, //returns all cells' data
dataType: 'json',
type: 'POST',
success: function (res) {
if (res.result === 'ok') {
$console.text('Data saved');
}
else {
$console.text('Save error');
}
},
error: function () {
$console.text('Success!');
}
});
});
</script>
<div id="dataGrid"></div>
<div id="dataCoonsole"></div>
<input type="button" value="Save" name="save">