This topic contains 1 reply, has 2 voices, and was last updated by Valerii Yustyniuk 4 years, 10 months ago.
- Topic
My current datagrid shows like this:
I want it to show like this:
my datagrids.yml
123456789101112131415161718192021222324252627282930313233343536373839404142datagrids:razoyo-productbybrand-grid:# extends: frontend-product-search-gridoptions:frontend: trueentityHint: oro.product.entity_plural_labelentity_pagination: truerequireJSModules:- oroproduct/js/app/datagrid/frontend-product-display-options-builder- oroproduct/js/app/datagrid/frontend-product-filters-events-dispatcher-builderextended_entity_name: '%oro_product.entity.product.class%'source:type: ormquery:select:- product.id# - product.sku# - product.brand as- product.denormalizedDefaultName as productName# - product.pagetemplate_id# - product.category_idfrom:- { table: '%oro_product.entity.product.class%', alias: product }where:and:- product.brand = :brandIdbind_parameters:# Get the "brandId" parameter from the datagrid# and set its value to the "brandId" parameter in the datasource querybrandId: brandIdcolumns:productName:label: oro.product.names.labelproperties:id: ~view_link:type: urlroute: oro_product_frontend_product_viewparams: [ id ]newArrival: ~unit: ~my productsbybrand.yml
12345678layout:actions:- '@setBlockTheme':themes: 'productsbybrand.html.twig'- '@add':id: product_by_brand_blockparentId: page_contentblockType: blockmy productsbybrand.html.twig
123456789101112{% block _product_by_brand_block_widget %}{% import 'OroDataGridBundle::macros.html.twig' as dataGrid %}{% include 'OroDataGridBundle:js:toolbar.html.twig' %}<div class="js-frontend-datagrid-grid-views-tpl"></div>{% block content %}{# Accessing route id from request and passing that in as brandId #}{{ dataGrid.renderGrid('razoyo-productbybrand-grid', {brandId: app.request.get('id')}) }}{% endblock %}{% endblock %}- This topic was modified 4 years, 11 months ago by Shahriar.
The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.