ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

Open-Source CRM software Forums OroCRM OroCRM – Programming Questions Customizing the fields shown in DataGrids

This topic contains 2 replies, has 3 voices, and was last updated by oro_newbie oro_newbie 6 months, 3 weeks ago.

  • Creator
    Topic
  • #7674

    bcappello
    Participant

    Hello.

    I’ve added some custom fields to the Account entity, using the OroExtendExtension, and I’d like them to show up on the Account DataGrid. At first, I found the yaml definition, but this didn’t seem like it was meant to be overridden. Rather, events seem to be the recommended way. This works, but it involves enough code to make me think I’m doing it wrong.

    Here’s the calling code:

    And the BaseDataGridListener class, the 200-line cause of my suspicions of improper use:

    Does anybody know of a better way to accomplish what seems like rather basic datagrid-manipulation functionality?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #7775
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Hello, bcappello.

    You can specifiy whether you want to show new fields in datagrid in field configuration. The same thing can be done with datagrid filters.

    However if you don’t like the look of whole grid you can use events – and here your approach with pre build event in completely correct. The only thing I’d like to recommed you – instead of writing of so much code you can simply extend existing grid in YML file and replace whole configuration of existing grid with new one instead of fixing each section one by one.

    #21689
    oro_newbie
    oro_newbie
    Participant

    Just in case anyone’s using the above reorder() method and have a problem with ‘tags’ getting displayed/ ‘tags’ filter not showing up, here’s what I did:

    When calling the redorder() method, I pass an extra parameter:

    Then in my reorder method, I check for the ‘tags’ key:

    Because when it comes to filters, the ‘tags’ must be linked to the ‘tagname’. Searching for the key ‘tags’ in $filters array would result in error.

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

You must be logged in to reply to this topic.