0
這裏是我的刪除代碼這是我的詳細信息頁面上:如何在從詳細信息頁面刪除後導航回列表頁面?
/// <reference path="~/GeneratedArtifacts/viewModel.js" />
myapp.ViewReceipt.DeleteReceipt_execute = function (screen) {
msls.showMessageBox("Are you sure you want to delete this record?", {
title: "Confirm Delete",
buttons: msls.MessageBoxButtons.okCancel
})
.then(function (result) {
if (result === msls.MessageBoxResult.ok) {
screen.getReceipt().then(function (receipt) {
receipt.deleteEntity();
//Save changes
myapp.applyChanges().then(null, function fail(e) {
// If error occurs, show the error.
msls.showMessageBox(e.message, { title: e.title }).then(function() {
// Discard Changes
screen.details.dataWorkspace.ApplicationData
.details.discardChanges();
});
});
//navigate back to list page
this.window.location.href = '#/BrowseReceipts.lsml'; //this doesn't work for me
});
}
});
};