Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#btnConfirm").click(function() {
- saveSomething();
- });
- function saveSomething() {
- var dfd = $.Deferred();
- MyApplication.Common.AlertService.prompt("U sure? U wanna save?", "Save").then(function () {
- var id = 123;
- $.ajax({
- type: "POST",
- url: $.makeUrl("SomeController", "SomeAction"),
- data: { id: id },
- dataType: "json",
- async: false,
- cache: false,
- success: function (response) {
- if (response.IsError) {
- MyApplication.Common.Core.ShowErrorMessage(response.Message);
- }
- else
- {
- var entityGrid = $("#MyDataGrid").data("kendoGrid");
- entityGrid.dataSource.read();
- }
- }
- }).then(function () {
- dfd.resolve();
- });
- });
- return dfd.promise();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement