0

我想将数组DataGrid作为参数传递。目前我将单个值传递为:

.twig 文件

dataGrid.renderGrid(gridName, { products: '34'}, { cssClass: 'inner-grid' })

数据网格.yml 文件

bind_parameters:

            -   name: products
                default: null
                type: integer

但我想传递一个数组并将该数组与DataGrid. 我想要解决方案。

4

1 回答 1

0

数据网格.yml

source:
        type: orm
        query:
            select:
                - product.id
                - product.name
                - product.quoteQuantity
                - product.discount
                - product.customPrice

            from:
                - { table: %inventory_product.product.entity.class%, alias: product }
            where:
                and:
                    - product.id IN (:products)
        bind_parameters:
            -   name: products

.twig 文件

dataGrid.renderGrid(gridName, { products: productdata}, { cssClass: 'inner-grid' })

只需将数组作为参数传递并将其与数据网格文件绑定即可

于 2017-02-07T05:05:09.347 回答