Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Admin panel - fix delete selected products

KrzysztofPajak79d060ed8611
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/List.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/List.cshtml
index 50da59b2a..03bbdc73a 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/List.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/List.cshtml
@@ -299,28 +299,27 @@
});
$('#delete-selected').click(function(e) {
+ if (confirm('@Loc["Admin.Common.AreYouSure"]')) {
+ var postData = {
+ selectedIds: selectedIds
+ };
+ addAntiForgeryToken(postData);
- e.preventDefault();
-
- var postData = {
- selectedIds: selectedIds
- };
- addAntiForgeryToken(postData);
-
- $.ajax({
- cache: false,
- type: "POST",
- url: "@(Url.Action("DeleteSelected", "Product", new { area = Constants.AreaAdmin }))",
- data: postData,
- complete: function(data) {
- var grid = $('#products-grid').data('kendoGrid');
- grid.dataSource.read();
- },
- error: function(xhr, ajaxOptions, thrownError) {
- alert(thrownError);
- },
- traditional: true
- });
+ $.ajax({
+ cache: false,
+ type: "POST",
+ url: "@(Url.Action("DeleteSelected", "Product", new { area = Constants.AreaAdmin }))",
+ data: postData,
+ complete: function (data) {
+ var grid = $('#products-grid').data('kendoGrid');
+ grid.dataSource.read();
+ },
+ error: function (xhr, ajaxOptions, thrownError) {
+ alert(thrownError);
+ },
+ traditional: true
+ });
+ }
return false;
});