以下是我的详细信息页面上的删除代码:
/// <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
});
}
});
};
答案 0 :(得分:1)
您应该能够通过修改代码来使用myapp.navigateBack()方法来实现这一目标。
一旦applyChanges成功完成,应该通过实现其onComplete回调来执行此方法,如以下修订示例所示:
B = kron(speye(M),ones(K));
B(logical(B)) = A;