Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could the export menu export all data not only the shown. #423

Closed
jiansongjay opened this issue Jan 3, 2016 · 7 comments
Closed

Could the export menu export all data not only the shown. #423

jiansongjay opened this issue Jan 3, 2016 · 7 comments

Comments

@jiansongjay
Copy link

The export in gridview just export the data which is shown. Could it be set exporting all data.

@kartik-v
Copy link
Owner

kartik-v commented Jan 3, 2016

Its intended to only export records displayed on the client browser and mentioned in docs. You can show all records (using toggle all button option) and then export if you need.

OR you can use yii2-export-menu extension (which exports server data).

@kartik-v kartik-v closed this as completed Jan 3, 2016
@cttlhy
Copy link

cttlhy commented Aug 21, 2017

The following it works. Just add 'batchSize' => 20.I don't know what is the principle.
<?php echo ExportMenu::widget([ 'dataProvider' => $dataProvider, 'columns' => $columns, 'fontAwesome' => true, 'batchSize' => 20, 'showConfirmAlert' => false, 'target' => GridView::TARGET_BLANK, 'dropdownOptions' => [ 'label' => 'Export All', 'class' => 'btn btn-default' ], 'exportConfig' => [ ExportMenu::FORMAT_TEXT => false, ExportMenu::FORMAT_PDF => false, ExportMenu::FORMAT_EXCEL_X => false, ExportMenu::FORMAT_HTML => false, ], ]);

@Sanjeev-Gupta
Copy link

You can use __clone() function of dataprovider yii2. By passing a seperate cloned dataprovider to ExportMenu widget you can gel all rows exported at a time.

@Sanjeev-Gupta
Copy link

You can use __clone() function of dataprovider yii2. By passing a seperate cloned dataprovider to ExportMenu widget with pagination set to false , you can get all rows exported at a time.

@bukohub
Copy link

bukohub commented May 27, 2020

@kartik-v, is so sad have to do that. Not is the best option for my user. Can u recommend other option? Thank u.

@kartik-v
Copy link
Owner

@bukohub You need to write the code to achieve your use case accordingly... Have a different dataprovider or a different search model method for your export menu and a different one for the gridview. This entirely depends on how your search method is returning records. For getting all records write your search query for export menu dataprovider accordingly to return all records.

@sephmwaura
Copy link

@kartik-v
i have over 2000 records ,how can i export the data per page so that i get all the data ? or is there's another way i can export all the data without the portal timing out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants