cause of the deleteFunction issue, the ajax support removed

This commit is contained in:
AmooAti 2021-08-13 12:38:28 +04:30
parent 5dcf5211a8
commit f0906bf5c4
3 changed files with 10 additions and 5 deletions

View File

@ -124,6 +124,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")'
]);
$this->addMassAction([

View File

@ -21,7 +21,8 @@
{!! view_render_event('bagisto.admin.catalog.categories.list.before') !!}
<div class="page-content">
<datagrid-plus src="{{ route('admin.catalog.categories.index') }}"></datagrid-plus>
@inject('products', 'Webkul\Admin\DataGrids\CategoryDataGrid')
{!! $products->render() !!}
</div>
{!! view_render_event('bagisto.admin.catalog.categories.list.after') !!}
@ -30,6 +31,13 @@
@push('scripts')
<script>
function reloadPage(getVar, getVal) {
let url = new URL(window.location.href);
url.searchParams.set(getVar, getVal);
window.location.href = url.href;
}
$(document).ready(function(){
$("input[type='checkbox']").change(deleteFunction);
});

View File

@ -57,10 +57,6 @@ class CategoryController extends Controller
*/
public function index()
{
if (request()->ajax()) {
return app(CategoryDataGrid::class)->toJson();
}
return view($this->_config['view']);
}