ssossossosso

Forums

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

This topic contains 5 replies, has 2 voices, and was last updated by Mike Kudelya Mike Kudelya 1 year, 3 months ago.

  • Creator
    Topic
  • #21395
    oro_newbie
    oro_newbie
    Participant

    Hi,

    I have extended the Account Bundle as per here and placed my custom views in the app/Resources/{BUNDLE_NAME}/views/ directory. This works fine and I can override the datagrid.yml file the same way.

    But I need to make few changes with the way the records of Accounts are displayed and this I believe can only be modified using an event listener. As such, where do I place the EventListener? I have seen Yehven’s advice here along with link to the code but it doesn’t explain for extended bundles I think.

    I tried placing the EventListener (which looks same like the CallListener in the above link) at app\Resources\OroCRMAccountBundle\EventListener\Datagrid\AccountListener.php but that doesn’t work. I even tried placing the same path in src/ instead of app/ but no luck either. Does this need to be registered in services.yml of the Account Bundle (well I tried that too).

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #21416
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi,

    I have created new bundle OroBundle. Here i explained how to do it. Further i created src/Custom/Bundle/OroBundle/EventListener/AccountListener.php

    and registered it in src/Custom/Bundle/OroBundle/Resources/config/services.yml:

    Do not forget add services.yml to dependency injection extension, in my case it is here src/Custom/Bundle/OroBundle/DependencyInjection/CustomOroExtension.php ([namespace][bundle name]Extension.php)

    #21444
    oro_newbie
    oro_newbie
    Participant

    Hi Mike,

    Thanks for the above. It works quite well.

    In my case, I was trying to override the datagrid so my services.yml went like this:

    I understand that the “accounts-grid” above should be the name of the grid (which can be found in datagrid.yml or in the markup of the grid that you need to modify). Regarding the event parameter:

    do you know how this is getting derived?

    Thanks.

    #21464
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi,

    Can you explain more detail about “do you know how this is getting derived?” ? “oro_datagrid.datagrid.build.before.accounts-grid” is dynamic event name, just write right grid name there and fill method section.

    #21470
    oro_newbie
    oro_newbie
    Participant

    Hi Mike,

    What I actually meant was, is it something like [bundle_name].object.event etc.? Do you know where I can find the list of such events that can be used with datagrid? That would be very helpful.

    Thanks.

    #21539
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi,

    You can find them there: Oro\Bundle\DataGridBundle\Event

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

You must be logged in to reply to this topic.