object json
object json

Reputation: 615

Why doesn't Popup Kendo close when I click on Update?

When Popup window opens and I click on update, the window doesn't close

I want the window close when I click on Update

jsfiddle code

Button update code

save: function (e) {

            $.ajax({

                url: '/api/apdevice',
                type: 'POST',
                contentType: 'application/json',
                data: JSON.stringify(e.model),

                success: function (data) {
                  alert('yes');

                },

                error: function (data) {
                   alert('no');
                }

            });
        }

Upvotes: 2

Views: 3862

Answers (1)

ryan
ryan

Reputation: 6655

You need to tell the grid what to do after a success or error. Check out the grid methods. In this example I used refresh and cancelRow.

save: function (e) {
    var that = this;
    $.ajax({

        url: '/api/apdevice',
        type: 'POST',
        contentType: 'application/json',
        data: JSON.stringify(e.model),
        success: function (data) {
            alert('yes');
            that.refresh();
        },

        error: function (data) {
            alert('no');
            that.cancelRow();
        }

    });
}

Here's some updated fiddles:

Upvotes: 4

Related Questions