Forums OroPlatform OroPlatform – Programming Questions Display different datagrid columns based on selected filter value

This topic contains 2 replies, has 3 voices, and was last updated by  Yevhen Shyshkin 1 year, 10 months ago.

  • Creator
  • #28597


    Hello, I would like to have a datagrid that shows some data from the database. The grid has some filters too (choice filter) that should not only filter the data, but also change the displayed columns. For example, let’s say the list of all table columns are:

    • ColumnA
    • ColumnB
    • ColumnC

    And the filter values are:

    • FilterA
    • FilterB

    The first column must always be shown, regardeless of the filter value. If I choose FilterA, then only the columns ColumnA and ColumnB should be visible. If I choose FilterB instead, only columns ColumnA, ColumnC should be visible. Is it possible to do something like this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #28598

    Artem Liubeznyi

    Hi Stefano,

    Looks like grid views might solve your case.


    Yevhen Shyshkin


    Grid views allow you to save different grid states under some names.

    If you require more flexible or dynamic logic – you should do that on JavaScript level. You can add your JS datagrid builder and put there your logic – e.g. you can listen to collection event (beforeFetch or sync), read collection’s state and show/hide some columns depends on filters value (see renderable option of a column).

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

You must be logged in to reply to this topic.