Skip to content

Commit

Permalink
minor #315 [Docs] Add info about available form options (loic425)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.12 branch.

Discussion
----------

Based on #317 

Commits
-------

6cf5690 [Docs] Add info about available form options on filters
  • Loading branch information
GSadee authored Jan 5, 2024
2 parents b7f4976 + 6cf5690 commit c9a493e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@ sylius_grid:
type: entity
form_options:
class: "%app.model.channel.class%"
# You can pass any form options available in Entity Type
# See https://symfony.com/doc/current/reference/forms/types/entity.html
multiple: true
customer:
type: entity
form_options:
Expand All @@ -525,7 +528,12 @@ return static function (GridConfig $grid): void {
$grid->addGrid(GridBuilder::create('app_user', '%app.model.user.class%')
->addFilter(
Filter::create('channel', 'entity')
->setFormOptions(['class' => '%app.model.channel.class%'])
->setFormOptions([
'class' => '%app.model.channel.class%'
// You can pass any form options available in Entity Type
// See https://symfony.com/doc/current/reference/forms/types/entity.html
'multiple' => true,
])
)
->addFilter(
Filter::create('customer', 'entity')
Expand All @@ -535,6 +543,7 @@ return static function (GridConfig $grid): void {
// can be simplified using EntityFilter
->addFilter(
EntityFilter::create('channel', '%app.model.channel.class%')
->addFormOption('multiple', true)
)
->addFilter(
EntityFilter::create('customer', '%app.model.customer.class%')
Expand Down

0 comments on commit c9a493e

Please sign in to comment.