将数组作为绑定参数传递给 orocrm 中的数据网格
Pass array as a bindparameter to the datagrid in orocrm
我想将 DataGrid
中的数组作为参数传递。目前我将单个值传递为:
.twig 文件
dataGrid.renderGrid(gridName, { products: '34'}, { cssClass: 'inner-grid' })
datagrid.yml 文件
bind_parameters:
- name: products
default: null
type: integer
但我想传递一个数组并将该数组与 DataGrid
绑定。
我想要解决方案。
datagrid.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' })
只需将数组作为参数传递并将其与数据网格文件绑定
我想将 DataGrid
中的数组作为参数传递。目前我将单个值传递为:
.twig 文件
dataGrid.renderGrid(gridName, { products: '34'}, { cssClass: 'inner-grid' })
datagrid.yml 文件
bind_parameters:
- name: products
default: null
type: integer
但我想传递一个数组并将该数组与 DataGrid
绑定。
我想要解决方案。
datagrid.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' })
只需将数组作为参数传递并将其与数据网格文件绑定