OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Datagrid Choice Filter with choices from a Column

This topic contains 9 replies, has 6 voices, and was last updated by  Andrey Yatsenko 4 years, 8 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #34160

    Dima Makaruk
    Participant

    How is it possible to create a datagrid filter that contains distinct values from a column of the grid ?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Author
    Replies
  • #34161

    Artem Liubeznyi
    Spectator

    Hi Dima,

    Not sure I correctly understand your question. Would you mind to provide a concrete use case you’d like to achieve? Thank you.

    #34162

    Mike Kudelya
    Participant

    Hi!

    You should create custom provider, which return list of entities and configure QueryBuilder as you want.

    setup provider as service

    and configure your filter, something like this:

    #34163

    Dima Makaruk
    Participant

    Hi

    Thank you for the quick reply. I think it won’t work with the provider. I need to get only the values/entities that are present in the datagrid resultset. But the filters are build before the datagrids datasource has the results.

    #34164

    Mike Kudelya
    Participant

    You want to put to filter values from certain column only from current page, right?

    #34165

    Dima Makaruk
    Participant

    Yes,
    from current datagrid.

    #34166

    oro_newbie
    Participant

    @Mike

    I needed this and it’s very well explained. Thank you!

    #34167

    oro_newbie
    Participant

    @Mike

    As an added question, is it possible to pass a parameter to the getList() function? In my case the parameter is the same that I’m passing to my where clause in my datagrid (defined under bind_parameters).

    #39912

    anis.kaypooor
    Participant

    Hi
    I have similar issue. I have a datagrid which on one of its columns, choices data must be loaded dynamically. I need to load them conditional according to passed parameter.

    How can I pass parameter to method: “getCategoryOptionTargetFields()”?

    Regards

    #39924

    Andrey Yatsenko
    Moderator

    Please have a look at datagrid listeners, they are more flexible than the configuration
    https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/DataGridBundle/Resources/doc/backend/events.md

Viewing 9 replies - 1 through 9 (of 9 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top