PreEdit event or PreSubmit event

PreEdit event or PreSubmit event

eyal_hbeyal_hb Posts: 98Questions: 31Answers: 0

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
                }
            }


    });

Answers

  • colincolin Posts: 15,145Questions: 1Answers: 2,586

    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

This discussion has been closed.