Grid with multiple Resource Models
-
14-02-2021 - |
Вопрос
I'm trying to use one grid for multiple ResourceModels, so far I've got one grid working fine.
I can load the grid up fine using http:{}/admin/grid/grid/
However when i create a new route to load the same controller: http:{}/admin/grid2/grid/ . I get no main block content
Here's my component UI based grid setup: Works fine for route /admin/grid/grid.
Does anyone know if i need to duplicate some files/directories to get grid2 to show?
Решение
You need to create grid2_grid_index.xml file under layout same as grid_grid_index.xml
Другие советы
You have to copy only layout
file, due to 'grid2' route already mentioned in routes.xml
.
You need to create only grid2_grid_index.xml
.
copy grid_grid_index.xml
to grid2_grid_index.xml
you can call same ui_component
file in that layout.xml file.