Continuing the discussion from Validate a specific row or cell:
Handson table ajax submit only if particular row is filled completely
Hi @sumanthhs48
Could you share more details? Could you share a demo with a description on how to replicate the issue?
Hi @aleksandra_budnik
put validation check for ajax submit only submits after filling complete row please help
hot.updateSettings({
afterChange: function (changes, source) {
var rowThatHasBeenChanged = changes[0][0],
columnThatHasBeenChanged = changes[0][1],
previousValue = changes[0][2],
newValue = changes[0][3];
var visualObjectRow = function (row) {
var obj = {},
key, name;
for (var i = 0; i < hot.countCols(); i++) {
obj[hot.colToProp(i)] = hot.getDataAtCell(row, i);
}
return obj
};
var json = {};
var changedRow = visualObjectRow(rowThatHasBeenChanged);
// console.log(visualObjectRow(rowThatHasBeenChanged))
Object.keys(changedRow).forEach(function (key) {
json[headerRow[key].replace(/\s+/g, ‘’)] = changedRow[key]
});
if (idArray[rowThatHasBeenChanged] !== undefined) {
json[‘id’] = idArray[rowThatHasBeenChanged]
} else {
json[‘id’] = null
}
var url = ‘’;
var type = ‘’;
var id = json[‘id’];
if (idArray[rowThatHasBeenChanged] !== undefined) {
url = ‘/purchase-entry/update/’ + id;
type = ‘POST’
} else {
url = ‘/purchase-entry’;
type = ‘POST’
}
$.ajax({
type: type,
url: url,
dataType: ‘json’,
data: {
json: json
},
success: function (data) {
console.log(“data loaded”);
},
error: function (data) {
console.log(“Failed”);
}
});
}
});
I am afraid that with that case we would need to proceed with a code review. Could you please contact us at support@handsontable.com to provide you license details?