0

这就是我当前数据网格的显示方式:

当前数据网格

我试图扩展核心frontend-product-search-grid,但它似乎也没有风格

我的datagrids.yml

datagrids:
    razoyo-productbybrand-grid:
        # extends: frontend-product-search-grid
        options:
            frontend: true
            entityHint: oro.product.entity_plural_label
            entity_pagination: true
            requireJSModules:
                - oroproduct/js/app/datagrid/frontend-product-display-options-builder
                - oroproduct/js/app/datagrid/frontend-product-filters-events-dispatcher-builder
        extended_entity_name: '%oro_product.entity.product.class%'    
        source:
            type: orm 
            query:
                select:
                    - product.id
                   # - product.sku
                   # - product.brand as 
                    - product.denormalizedDefaultName as productName
                   # - product.pagetemplate_id
                   # - product.category_id
                from:
                    - { table: '%oro_product.entity.product.class%', alias: product }
                where:
                    and:
                    - product.brand = :brandId
            bind_parameters:
                # Get the "brandId" parameter from the datagrid
                # and set its value to the "brandId" parameter in the datasource query
                brandId: brandId            

        columns:
            productName:
                label: oro.product.names.label
        properties:
            id: ~
            view_link:
                type:  url 
                route: oro_product_frontend_product_view
                params: [ id ]
            newArrival: ~
            unit: ~

我的产品bybrand.yml

layout:
    actions:
        - '@setBlockTheme':
            themes: 'productsbybrand.html.twig'
        - '@add':
            id: product_by_brand_block
            parentId: page_content
            blockType: block

我的产品bybrand.html.twig

{% 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 %}

这就是我希望它展示的方式: 所需的数据网格

4

0 回答 0