OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – How do I? Questions Download action in datagrid

This topic contains 3 replies, has 2 voices, and was last updated by  Yevhen Shyshkin 7 years, 11 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
  • #36220

    mike_m
    Participant

    I want to implement a download link for rtf file in a datagrid.

    datagrid.yml:

    But if I clicked on the download-icon the framework sends an ajax request is send to the server and the loading animation shows up. The content of the file is rendered in the page directly.
    How is the correct configuration for downloads?

    Thanks in advance.

    Regrads Mike

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #36221

    Yevhen Shyshkin
    Participant

    Hello, Mike.

    This is really odd, but look’s like we don’t have appropriate action to download files via grid action. We definitely have to add such action type.

    But for now there are several solutions:

    1) you can create such action yourself based on navigation action (we’ll be happy to receive pull request with this functionality)

    2) you can just create custom twig template for one of the columns (or create new column) and render there link to your file, just don’t forget to add class “no-hash” to it to disable regular navigation.

    #36222

    mike_m
    Participant

    Hello,

    I am sorry to answer so late, but I was in the hospital.

    I implemented solution 1. I do not know how to pull this into git.
    Here are my source files.

    DownloadAction.php

    service.yml

    download-action.js

    datagrid.yml

    #36223

    Yevhen Shyshkin
    Participant

    Thank you!
    We will, probably, use this code in platform.

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

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

Back to top