0
は、私はこれにしたい:ユーザーが好みのボタンをクリックした場合、私は、ダイアログボックスを表示もう一度ダイアログを閉じることはできませんか?
「レポートは、お気に入りに追加」し、ユーザーは
「レポートは、お気に入りから削除私は、ダイアログボックスを作成したお気に入りボタン二回目をクリックした "
しかし、ダイアログボックスは同じIDを持ちます。
私のコードの次
$scope.toogleReportToFavorites = function (item) {
if (!item.isInFavorites) {
item.isInFavorites = true;
RepService.AddToDefaultFavourites(item.ReportId, function (reportCat) {
if ($scope.showRemovedDialog) {
$("#denemePicker").dialog("close"); //its works only first time
$scope.showAddedDialog = false;
}
else {
$scope.showAddedDialog = true;
}
WarningDialogs("Report added to favorites");
}, function (ex) {
GlobalErrorHandler(ex);
});
} else {
item.isInFavorites = false;
RepService.RemoveFromFavourites(item.ReportId, function() {
if ($scope.showAddedDialog) {
$("#denemePicker").dialog("close");
$scope.showRemovedDialog = false;
}
else {
$scope.showRemovedDialog = true;
}
WarningDialogs("Report removed from favorites");
}, function (ex) {
GlobalErrorHandler(ex);
});
}
};
と、これは私のWarningDialogs機能コードです:
function WarningDialogs(text, messageType, dialogWidth, callback, textAlign) {
if (textAlign == null || textAlign.length < 1) {
textAlign = 'center';
}
$('<div>', { title: "deneme", id: 'denemePicker' }).html(text).css('text-align', textAlign).dialog(
{
resizable: true, modal: true, closeOnEscape: true, width: dialogWidth,
create: function() {
isWarningDialogsShown = true;
$(this).css('maxHeight', '300px');
},
close: function (event, ui) {
isWarningDialogsShown = false;
if (callback) {
callback();
}
},
buttons: {
Close: function() {
$(this).dialog("close");
}
}
}).css('overflow', 'auto');
return;
}
私はいつもこのために仕事をしたい:$("#denemePicker").dialog("close");
が、その唯一の仕事は初めて。私は理由が同じだと思う?
どうすればいいですか?