OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Customizing the fields shown in DataGrids

This topic contains 3 replies, has 4 voices, and was last updated by  Pedro Molina 6 years, 10 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
  • #24970

    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 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #24971

    Yevhen Shyshkin
    Participant

    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.

    #24972

    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.

    #24973

    Pedro Molina
    Participant

    Hi guys, i dont know if i´ts too late for this. Im using the code posted by bcapello. It works for me, but anybody knows how to show in the “many to one” field a method parameter? like getFullName(), because i need to show 2 fields concatenated. Thanks in advance.

    PD: I dont know how could i use the datagrid extended, there is no proper documentation for that. Is it like the views? recreating the directory in my custom bundle extending the oro bundle? I did something like that but it doesnt show changes, i wonder if there are parts im missing…

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

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

Back to top