I’m new to handsontable and have inherited an ASP.Net with Razor application that utilizes it on an existing page. I had to add another and changed certain names to avoid colliding with the other hot. My issue is pretty well explained here (including picture of the issue). Any ideas what I’m doing wrong? The hot that I copied the code from still works correctly.
Here’s the relevant code:
var $autosave2 = $('#autosave2');
var $container2 = $("#handsontable2");
var handsontable2 = $container2.data('handsontable2');
var console2 = $("#divButtons2").find("#exampleconsole2");
console2.text("Data loaded from SQL database...");
data2 = $.getValues(ajaxUrl2)
var config2 = {
data: data2,
autoWrapRow: true,
colHeaders: ['<b>Lot</b>', '<b>Product</b>', '<b>Customer</b>', '<b>Qty</b>'],
colWidths: [
75, //Lot
75, //Product
425, //Customer
70, //Qty
],
manualColumnResize: true,
columns: [ { data: 'LotId', @readOnly2 }, { data: 'ProductCode', @readOnly2 }, { data: 'Customer', @readOnly2 }, { data: 'Qty', @readOnly2 } ],
afterChange: function (change, source) {
if (source === 'loadData') {
return; //don't save this change
}
var hot2;
var hot2 = new Handsontable($container2[0], config2);