I’m trying to pass handsontable cells’ data vi ajax json. But the column property is not display. Here is the code:
hot = new Handsontable(container, {
startRows: 1,
startCols: 6,
renderAllRows: true,
height: 100,
manualColumnMove: true,
manualRowMove: true,
fixedRowsTop: 0,
fixedColumnsLeft: 1,
manualColumnResize: true,
manualRowResize: true,
colWidths: [150, 200, 100, 125, 125, 150],
colHeaders: ['Company', 'RFQ subject', 'Deadline', 'Buyer firstname', 'Buyer lastname', 'Email'],
columns: [{
data: 'company'
}, {
data: 'name'
}, {
data: 'deadline'
}, {
data: 'firstname'
}, {
data: 'lastname'
}, {
data: 'email'
}
]
});
Handsontable.Dom.addEvent(save, 'click', function() {
$.ajax({
url: "/datatables/add/",
dataType: "json",
type: "POST",
data: {"data": hot.getSourceData()},
success: function (res) {
console.log(data.toString());
closeModal();
},
error: function (res) {
//console.log("error", data);
}
});
});
The result is:
data[0][]:
data[0][]:
data[0][]:
data[0][]:
data[0][]:
data[0][]: