OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – How do I? Questions Datagrid: view action as *real* link?

This topic contains 5 replies, has 3 voices, and was last updated by  andesk 6 years ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #35835


    Hi there again :)

    We would like to use tabbed browsing in our application and that is not working that good in datagrids when having defined a rowAction. On the other hand we would like to quickly open tabs, therefore the actions menu at the end of datagrid’s rows is a little UX overhead.

    So our idea was/is to display the link for first “identifier” column of each grid row. What we currently do to achieve this is using “type: twig” with “frontend_type: html” in datagrid.yml for that column definition and hardcoding the view link in that custom twig template on our own, as we did not find a way to retrieve the datagrid row action urls inside twig scope… But as we duplicate url logic this way we would like to find a smarter solution probably integrated in datagrid bundle itself.

    Is there currently any solution to convert a column value to a link, e.g. by configuring the column as type: “action_link” or so? What do you think of introducing such thing, of not?

    Thanks for advice :)

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

    Alexandr Smaga

    Hello. Yes, that’s possible. You can run

    in order to see which variables are available in template.

    In order to fetch property from result record please try to use following code



    Hi Alexandr,

    thanks for response! :)

    I dumped _context and record myself, but could not find the view_link. I retried after your comment and checked, there is no value inside record.

    In which oro version is this supposed to be supported? I am using platform 1.3.0.

    The other thing: what I wanted to suggest is to add possibilty to configure a column as “view_link” or “edit_link” or whatever via datagrid.yml. What do you think about that? As I believe that tabbed browsing is needed for others too this could be a good enhancement.



    Ah! What I found out now by digging deeper:

    There is a type “url” already that renders the url depending on some configuration and record properties.
    Documentation found here: https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/DataGridBundle/Resources/doc/backend/extensions/formatter.md
    Implementation: https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/DataGridBundle/Extension/Formatter/Property/UrlProperty.php

    But it does not render a link, just the “raw” url. I introduced a custom formatter LinkProperty for type “link” now, reusing UrlProperty and it works quite good. Would maybe be an idea to add something like this to OroPlatform repository?

    Dima Soroka
    Dima Soroka

    Thanks, sure, please submit a PR



    https://github.com/orocrm/platform/pull/149 :)

    Maybe the implementation is a little bit “too easy”, but working fine for now and can be extended nearly as easy ;)

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

The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No