This topic contains 2 replies, has 2 voices, and was last updated by sndpl 10 years, 2 months ago.
- Topic
Hi,
I have a positions entity that can belong to one or more categories. So on the view/update of a position I want to show a grid with the categories.
In my position view template I have the following:
12345678910111213141516{% set positionCategoriesWidget %}{{ oro_widget_render({'widgetType': 'block','url': path('position_widget_categories', {id: entity.id}),'cssClass': 'inner-grid'}) }}{% endset %}{% set dataBlocks = dataBlocks|merge([{'title': 'Categories'|trans,'subblocks': [{'data' : [positionCategoriesWidget]}]}]) %}In the widget template:
1{{ dataGrid.renderGrid('position-categories-view-grid', { position: entity.id }) }}In the controller:
/**
* @Route("/widget/categories/{id}", name="position_widget_categories", requirements={"id"="\d+"})
* @Template()
*/
public function categoriesAction(Position $position)
{
return ['entity' => $position];
}and in my categories grid i use the following query (in datagrid.yml):
123456789query:select:- c.id- c.namefrom:- { table: Acme\Compman\Entity\Category, alias: c }where:and:- :position MEMBER OF c.positionsBut the :position is never replaced with the position id. I’m a missing something?
The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.