yii2-export icon indicating copy to clipboard operation
yii2-export copied to clipboard

DetailView widget export suggestion

Open RodrigoDornelles opened this issue 3 years ago • 8 comments

in addition to exporting in the gridview format, I think the variant for only one model is a good implementation (detail wiget)

use kartik\export\DetailExportMenu;
$gridColumns = [
    'id',
    'name',
    'color',
    'publish_date',
    'status',
];

echo DetailView::widget([
    'columns' => $gridColumns,
    'model' => $model
]);

echo DetailExportMenu::widget([
    'columns' => $gridColumns,
    'model' => $model
]);

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

RodrigoDornelles avatar Nov 17 '20 17:11 RodrigoDornelles

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 23 '21 06:01 stale[bot]

up.

RodrigoDornelles avatar Jan 23 '21 20:01 RodrigoDornelles

Use case doesn’t make any sense to me here. It seems like you’d have a single row, which could easily be done by filtering the grid, or trivially in a one-liner (not using yii2-export) to dump model properties and offer a csv to the browser in a model view page. Could you please explain in more detail?

On Sat, Jan 23, 2021 at 3:05 PM RodrigoDornelles [email protected] wrote:

up.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kartik-v/yii2-export/issues/339#issuecomment-766171438, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6OCQHK52KJT3MU6IKSJHTS3MTW5ANCNFSM4TY45FOA .

ThreepE0 avatar Jan 24 '21 16:01 ThreepE0

Use case doesn’t make any sense to me here. It seems like you’d have a single row, which could easily be done by filtering the grid, or trivially in a one-liner (not using yii2-export) to dump model properties and offer a csv to the browser in a model view page. Could you please explain in more detail?

Instead of a table it would be a single record sheet, just like DetailView widget shows the field on the left and the answer on the right.

It would be useful for reporting narrative, reviewing records, researchers, and other types of documents that are organized in this format.

example

RodrigoDornelles avatar Jan 24 '21 21:01 RodrigoDornelles

That makes sense. I think that this plugin isn’t suited (and I think maybe shouldn’t be) to that functionality, if I understand the use case correctly.

The plugin is designed for repeating data in a spreadsheet format, where you’re looking for a specific representation of a single model.

This seems like it’s a perfect case for a specific view page using yii’s own functionality; take the standard model view page for example; if you wanted an exportable output for that particular model, create a view for it, and add a button to the grid view or plain view linking to it. If you wanted to spit out html, json, pdf, xml, or whatever, that should be easy enough. You could use a variable in the url/controller action to decide which view gets used, or what format gets offered to the browser for download.

Please let me know if I’m misunderstanding anything. Please note I’m not the developer here, just a fellow user.

On Sun, Jan 24, 2021 at 4:43 PM RodrigoDornelles [email protected] wrote:

Use case doesn’t make any sense to me here. It seems like you’d have a single row, which could easily be done by filtering the grid, or trivially in a one-liner (not using yii2-export) to dump model properties and offer a csv to the browser in a model view page. Could you please explain in more detail?

Instead of a table it would be a single record sheet, just like DetailView widget shows the field on the left and the answer on the right.

It would be useful for reporting narrative, reviewing records, researchers, and other types of documents that are organized in this format.

[image: example] https://user-images.githubusercontent.com/29123479/105644367-fcc5bf00-5e73-11eb-93de-601bab1690c3.png

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kartik-v/yii2-export/issues/339#issuecomment-766437416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6OCQA6OCMFSMZ4WMAGOKLS3SIBTANCNFSM4TY45FOA .

ThreepE0 avatar Jan 24 '21 22:01 ThreepE0

It wouldn't be a necessity of mine, just a suggestion that I thought was a good case.

RodrigoDornelles avatar Jan 24 '21 22:01 RodrigoDornelles

I understand, thanks for clarifying

On Sun, Jan 24, 2021 at 5:59 PM RodrigoDornelles [email protected] wrote:

It wouldn't be a necessity of mine, just a suggestion that I thought was a good case.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kartik-v/yii2-export/issues/339#issuecomment-766454810, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6OCQEJ5PQLORX2PCECLQ3S3SQ4RANCNFSM4TY45FOA .

ThreepE0 avatar Jan 24 '21 23:01 ThreepE0

I'm interesred on it but couldn't find the "kartik\export\DetailExportMenu" class anywhere. Any suggestion for its refuge? In addition, some help on how to configure the kartik Export Menu "exportFormView" setting might clarify even more this topic. Thanks in advance.

gteruel avatar Jan 17 '22 13:01 gteruel