PreEdit event or PreSubmit event
PreEdit event or PreSubmit event

When i edit a row in my table, i want the option to show message (not alert) on the edit button click if condition happen
and the only on a click of button of the message continue the event
something like this:
editor.on('preEdit', function (e, json, data, id) {
console.log('preSubmit event');
var IsUsed = false;
var OrderNum = table.row(editor.modifier()).data().OrderNum;
var data = table.data().toArray();
data.forEach(function (row, i) {
if (row.OrderNum == OrderNum) {
IsUsed = true;
}
});
if (IsUsed == true) {
document.getElementById('myModalEditMessage').style.display = 'block';
document.getElementById('EditOk').onclick = function () {
document.getElementById('myModalEditMessage').style.display = 'none';
///submit the request
}
}
});
This discussion has been closed.
Answers
You could do something like this - the button text is changed when the form is opened, and clicking the button reverts the text to the original which allows it to be submitted.
Colin