PreEdit event or PreSubmit event

PreEdit event or PreSubmit event

eyal_hbeyal_hb Posts: 70Questions: 24Answers: 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: 7,698Questions: 0Answers: 1,298

    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

Sign In or Register to comment.