jQuery UI Widgets Forums Grid full row edit example: updaterow is triggered with ESC

This topic contains 2 replies, has 2 voices, and was last updated by  brasio 8 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • brasio
    Participant

    I don’t understand the functionality of the ESC key during a full row edit: I have noticed that updaterow event is called even if I press the ESC key, while I was expecting to cancel the operation. Is it a bug or is it by design?

    Is there any way to cancel the operation of updating a row in full row mode?

    Thanks


    Peter Stoev
    Keymaster

    Hi brasio,

    What’s the problem to have the updaterow called? It has 2 options – commit(false) and commit(true) to proceed and cancel the changes. On Esc, commit(false) should be called.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    brasio
    Participant

    Hi Peter. I don’t understand the functionality of the ESC key: it puts my row in not-editing mode without changing cell values, but unfortunately it still calls the updaterow callback function of the grid in order to send data to database. How should I call commit(false) in order to cancel the changes?

    My code is:

    
    updaterow: function (rowid, rowdata, commit) {	
                        $.ajax({
                            dataType: 'json',
    			type: 'POST',
                            url: 'myurl.php',
                            data: rowdata,
                            success: function (data, status, xhr) {
                            commit(true);
    			$('#jqxgrid').jqxGrid('updatebounddata'); //why updatebounddata if commit preserves cell changes???
                            },
                            error: function (xhr, tst, err) {
    			alert(err);
                            commit(false);
                            }
                        });
                    }
    
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.