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 Hiro Hiro 3 years, 2 months ago.

  • Creator
    Topic
  • #5712
    Hiro
    Hiro
    Participant

    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
    Replies
  • #5715
    Hiro
    Hiro
    Participant

    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.

    #5973
    Hiro
    Hiro
    Participant

    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?

    #5988
    Hiro
    Hiro
    Participant

    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:
    https://gist.github.com/hiro-iFactory/3e6dddfa31f6894d8d42

    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.

    #5992

    Hello,

    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.

    #6019
    Hiro
    Hiro
    Participant

    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.