diff --git a/app/Http/Controllers/FrontController.php b/app/Http/Controllers/FrontController.php index 53cfde5..1ad44ca 100644 --- a/app/Http/Controllers/FrontController.php +++ b/app/Http/Controllers/FrontController.php @@ -46,21 +46,24 @@ class FrontController extends Controller return view('dataset-detail',$data); } + public function gridDetail2025(Request $request){ + $id = $request->query('id'); + $keyId = $id; + $item = Dataset::find($keyId); // atau pakai ->pluck(), ->find(), dll + + $json = json_decode($item->data, true); + $limit = $request->input('limit', 10); + $offset = $request->input('offset', 0); + + $rows = array_slice($json, $offset, $limit); + return response()->json([ + 'total' => count($json), + 'rows' => $rows + ]); + } public function gridDetail(Request $request) { - // $id = $request->query('id'); - // $keyId = $id; - // $item = Dataset::find($keyId); // atau pakai ->pluck(), ->find(), dll - - // $json = json_decode($item->data, true); - // $limit = $request->input('limit', 10); - // $offset = $request->input('offset', 0); - - // $rows = array_slice($json, $offset, $limit); - // return response()->json([ - // 'total' => count($json), - // 'rows' => $rows - // ]); + $id = $request->query('id'); $keyId = decode_id($id); diff --git a/resources/views/dataset-detail.blade.php b/resources/views/dataset-detail.blade.php index 5a7f907..85c3d7a 100644 --- a/resources/views/dataset-detail.blade.php +++ b/resources/views/dataset-detail.blade.php @@ -54,7 +54,8 @@ {{-- Jumlah Row Data: 100 --}}