0
我需要用模態確認刪除行。如果我刪除第一行 - 刪除成功,但是如果刪除第二行和以後的行,當showWrating(errMessage)因爲記住的名字參數。我怎樣才能更新(設置爲零)名稱參數每OK按鈕點擊?用模態確認刪除
我Index.cshtml:
function delRow() {
vm.onEditRow(
function (name) {
showQuestion(function (isYes) {
if (isYes)
vm.onDelRow('@Url.Action("DelScheduler")', name,
function() {
refreshGrid();
},
function (errMessage) {
showWrating(errMessage);
}
);
});
},
function() {
showWrating('@Resources.NotSelectedRow');
});
}
My TypeScript:
onEditRow(onSuccess: (name: string) => {}, onError:() => {})
{
if (this.selectScheduler() == null)
onError();
else {
onSuccess(this.selectScheduler().name);
}
}
onDelRow(url: string, name: string, onSuccess:() => {}, onError: (message: string) => {})
{
this.invokeAjax(url, { name: name }, (data) => {
if (!data.succeeded) {
onError(data.error);
} else {
onSuccess();
}
});
}
BASarat,非常感謝你 – zrabzdn
@ user2382193不用擔心。如果它修復了它會感激它被標記爲答案。 – basarat