Skip to content

Instantly share code, notes, and snippets.

@PilotBob
Last active September 29, 2015 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PilotBob/0c67571f5bdcd13a9172 to your computer and use it in GitHub Desktop.
Save PilotBob/0c67571f5bdcd13a9172 to your computer and use it in GitHub Desktop.
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