Last active
September 29, 2015 20:53
-
-
Save PilotBob/0c67571f5bdcd13a9172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SaveGridAsync() { | |
ClearErrors(); | |
var myPromises = $(".open-sub-grid").map(function (i, o) { | |
var subGridData = $(o).data("kendoGrid"); | |
return subGridData.dataSource.sync(); | |
}).get(); | |
return $.when.apply($, myPromises) | |
.then(function () { | |
console.log('my code is very good and cool!'); | |
var grid = $("#CostTypeList").data("kendoGrid"); | |
return grid.dataSource.sync(); | |
}); | |
} | |
function AddRow() { | |
var grid = $("#CostTypeList").getKendoGrid(); | |
if (GridHasDirtyChildGrid(grid)) { | |
SaveGridAsync().then(function () { grid.addRow(); }); | |
} else { | |
grid.addRow(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment