File tree Expand file tree Collapse file tree 3 files changed +46
-2
lines changed
Expand file tree Collapse file tree 3 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 1+ # Api support - JSON Response
2+
3+ Jeżeli potrzebujesz możesz otrzemać rezultat w formacie JSON, zostanie zwrócony obiekt
4+ z polami:
5+
6+ ` formKey ` - klucz którego powinieneś użyć jeżeli będziesz chciał filtrować wynik
7+
8+ ` totalPages ` - Ostatnia dostępna strona
9+
10+ ` currnetPage ` - Aktualnie pobrana strona
11+
12+ ` data ` - Tablica zawierająca obiekty zgodne z konfiguracją grida
13+
14+ ### Przykład
15+
16+ Konfiguracja pochodzi z [ Przykład wykorzystania] ( baseExample.md ) zmieni się tylko akcja w kontrolerze
17+
18+
19+ ``` php
20+ <?php
21+
22+ namespace AppBundle\Controller;
23+
24+ use AppBundle\Grid\ExampleGrid;
25+ use AppBundle\Grid\ExampleAnotherGrid;
26+ use Makoso\DatagridBundle\Grid\Grid;
27+ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
28+ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
29+
30+ class DefaultController extends Controller
31+ {
32+ /**
33+ * @Route("/", name="homepage")
34+ */
35+ public function indexAction(Grid $grid)
36+ {
37+ return $grid->configure(new VirtualEntityGrid())->getJsonResponse();
38+ }
39+ }
40+
41+ ```
42+
43+ Gotowe!
Original file line number Diff line number Diff line change 1- #Przykład wykorzystania
1+ # Przykład wykorzystania
22
33Załóżmy że masz entity podobne do tego:
44
Original file line number Diff line number Diff line change 22
33 * [ Instalacja] ( install.md )
44 * [ Przykład wykorzystania] ( baseExample.md )
5- * [ MultipleGrid] ( multipleGrid.md )
5+ * [ MultipleGrid] ( multipleGrid.md )
6+ * [ Api support (JSONResponse)] ( apiSupport.md )
You can’t perform that action at this time.
0 commit comments