refactor: move product category sub-group datatable rendering from client-side JavaScript to a dedicated server-side Blade partial.

This commit is contained in:
pbao9
2026-02-12 08:22:39 +07:00
parent 99b61bfb51
commit 3b1beef66e
3 changed files with 49 additions and 40 deletions
@@ -123,7 +123,13 @@ class ProductCategoryController extends Controller
return '<div class="form-check d-flex align-items-center justify-content-center"><input class="form-check-input dt-checkbox" type="checkbox" value="' . $d->id . '"></div>';
}
)
->rawColumns(['details_control', 'action', 'is_active', 'checkbox'])
->addColumn(
'sub_group_html',
function ($d) {
return view('administrator.pages.product.categories.datatable.sub_group', ['children' => $d->children])->render();
}
)
->rawColumns(['details_control', 'action', 'is_active', 'checkbox', 'sub_group_html'])
->make(true);
}
}