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

Open-Source CRM software Forums OroCRM OroCRM – How do I? Questions How to get the data from Datagrid Action

This topic contains 5 replies, has 2 voices, and was last updated by Hiro Hiro 2 years, 6 months ago.

  • Creator
  • #5712

    Is it possible to get the response data from “rowClicked” event so that I can set field values to a form?

    Currently I have settings like this in datagrid.yml:

    And I can see FireBug sends the request and gets the response like:

    Currently the setting in datagrid.yml is used only to show the pointer icon on hovering the row because there seems to be no way to catch the event unless you bind the extra callback and send the request by yourself to get the data as follows:

    Is there a way to define the callback when the AJAX request happened originally?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
  • #5715

    In addition to this issue. I have created a controller like:

    And that is why it gets the response.

    I wonder if you guys can change the code in:

    to enable to execute a callback function mentioned in datagrid.yml somehow.


    I updated OroCRM repository today and noticed I can no longer refer the data like:

    because “data-datagrid” is gone.

    What is the proper way to catch the rowClicked event at FrontEnd?


    I ended up using custom version of the following files (as coping them into my bundle folder and change lines):

    • vendor/oro/platform/src/Oro/Bundle/DataGridBundle/Resources/public/js/app/components/datagrid-component.js
    • vendor/oro/platform/src/Oro/Bundle/DataGridBundle/Resources/views/macros.html.twig

    I have put the example here:

    I tried to amend the issue by creating an extension which provides the action as triggering rowClicked event with mediator, but my browser tries to load my javascript file from where pre-existing actions are (where orodatagrid/datagrid/action/xxxx-action.js is like http://localhost/bundles/oro/datagrid/action/frontend-action.js) even though my javascript file is loaded.



    Sorry for delay. I think the best solution for you would be to add your own grid builder to builders collection:

        In you bundle, for proper grid in datagrid.yml, add a builder as requireJSModule

        Builder’s init method will be invoked within grid building process:

    I hope, it’ll help.
    Thanks for your question.


    Thank you for the reply.

    Your solution worked. Now I can avoid using the customised version of core files.

    Thank you!

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

You must be logged in to reply to this topic.