diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php
index 818832d6e..26dcbeb27 100755
--- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php
+++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php
@@ -116,7 +116,7 @@ class CategoryDataGrid extends DataGrid
'route' => 'admin.catalog.categories.delete',
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
'icon' => 'icon trash-icon',
- 'function' => 'deleteFunction($event, "delete")'
+ 'function' => 'deleteCategory(event, "delete")'
]);
$this->addMassAction([
diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/index.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/index.blade.php
index a19a6c1de..e75e90004 100755
--- a/packages/Webkul/Admin/src/Resources/views/catalog/categories/index.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/index.blade.php
@@ -18,6 +18,7 @@
{{ __('admin::app.catalog.categories.add-title') }}
+
-
+
perPage
@{{ filter.label }}
@@ -348,7 +345,6 @@
this.type = this.columns[column].type;
switch (this.type) {
-
case 'string': {
this.stringConditionSelect = true;
this.datetimeConditionSelect = false;
@@ -394,7 +390,6 @@
this.nullify();
break;
}
-
}
}
}
@@ -463,7 +458,10 @@
this.formURL("search", 'all', searchValue, '{{ __('ui::app.datagrid.search-title') }}');
},
- // function triggered to check whether the query exists or not and then call the make filters from the url
+ /**
+ * Function triggered to check whether the query exists or not and then
+ * call the make filters from the url.
+ */
setParamsAndUrl: function () {
params = (new URL(window.location.href)).search;
@@ -522,7 +520,9 @@
document.getElementById('mass-action-form').action = this.massActionTarget;
},
- //make array of filters, sort and search
+ /**
+ * Make array of filters, sort and search.
+ */
formURL: function (column, condition, response, label) {
var obj = {};
@@ -665,7 +665,9 @@
}
},
- // make the url from the array and redirect
+ /**
+ * Make the url from the array and redirect.
+ */
makeURL: function () {
newParams = '';
@@ -697,7 +699,9 @@
window.location.href = clean_uri + newParams;
},
- //make the filter array from url after being redirected
+ /**
+ * Make the filter array from url after being redirected.
+ */
arrayFromUrl: function () {
let obj = {};
@@ -802,7 +806,9 @@
}
},
- //triggered when any select box is clicked in the datagrid
+ /**
+ * Triggered when any select box is clicked in the datagrid.
+ */
select: function () {
this.allSelected = false;
@@ -814,7 +820,9 @@
}
},
- //triggered when master checkbox is clicked
+ /**
+ * Triggered when master checkbox is clicked.
+ */
selectAll: function () {
this.dataIds = [];
@@ -873,40 +881,40 @@
this.filters.push({"column": "perPage", "cond": "eq", "val": e.target.value});
this.makeURL();
- }
- }
- });
+ },
+ doAction: function (e, message, type) {
+ let element = e.currentTarget;
- function doAction(e, message, type) {
- var element = e.currentTarget;
- if (message) {
- element = e.target.parentElement;
- }
-
- message = message || '{{__('ui::app.datagrid.massaction.delete') }}';
-
- if (confirm(message)) {
- axios.post(element.getAttribute('data-action'), {
- _token: element.getAttribute('data-token'),
- _method: element.getAttribute('data-method')
- }).then(function (response) {
- this.result = response;
-
- if (response.data.redirect) {
- window.location.href = response.data.redirect;
- } else {
- location.reload();
+ if (message) {
+ element = e.target.parentElement;
}
- }).catch(function (error) {
- location.reload();
- });
- e.preventDefault();
- } else {
- e.preventDefault();
- }
- }
+ message = message || '{{__('ui::app.datagrid.massaction.delete') }}';
+
+ if (confirm(message)) {
+ axios.post(element.getAttribute('data-action'), {
+ _token: element.getAttribute('data-token'),
+ _method: element.getAttribute('data-method')
+ }).then(function (response) {
+ this.result = response;
+
+ if (response.data.redirect) {
+ window.location.href = response.data.redirect;
+ } else {
+ location.reload();
+ }
+ }).catch(function (error) {
+ location.reload();
+ });
+
+ e.preventDefault();
+ } else {
+ e.preventDefault();
+ }
+ }
+ },
+ });
@endpush