Reputation: 615
When Popup window opens and I click on update, the window doesn't close
I want the window close when I click on Update
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
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