{"id":20980976,"url":"https://github.com/eseperio/yii2-exportable-gridview","last_synced_at":"2025-05-14T15:30:53.544Z","repository":{"id":56979267,"uuid":"123038918","full_name":"Eseperio/yii2-exportable-gridview","owner":"Eseperio","description":"Yii2 Gridview with full data export","archived":false,"fork":false,"pushed_at":"2025-02-15T23:17:18.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T03:05:51.346Z","etag":null,"topics":["gridview","widget","yii2","yii2-gridview","yii2-widgets"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eseperio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-26T22:25:16.000Z","updated_at":"2025-02-17T13:49:48.000Z","dependencies_parsed_at":"2022-08-21T10:50:12.053Z","dependency_job_id":null,"html_url":"https://github.com/Eseperio/yii2-exportable-gridview","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eseperio%2Fyii2-exportable-gridview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eseperio%2Fyii2-exportable-gridview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eseperio%2Fyii2-exportable-gridview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eseperio%2Fyii2-exportable-gridview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eseperio","download_url":"https://codeload.github.com/Eseperio/yii2-exportable-gridview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254171627,"owners_count":22026478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gridview","widget","yii2","yii2-gridview","yii2-widgets"],"created_at":"2024-11-19T05:32:21.275Z","updated_at":"2025-05-14T15:30:53.271Z","avatar_url":"https://github.com/Eseperio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yii2 Exportable Gridview\nGridview with **full data export**\n\nThis works as normal gridview, but adds a button to export the data loaded into it.\nIt exports all records found on the active record query. Works with the same data\nas the gridview does. Uses [phpspreadsheet](https://github.com/PHPOffice/PhpSpreadsheet)\nto generate export file.\n\n## How does it work\nFollowing the same behavior that pjax widget, this widget act as a normal gridview until\na request is made with the url query parameters `export-grid` and `export-container`.\nThe latter should contain the id of gridview without the hashtag. When both parameters are received, response\nis cleared and then spreadsheet generation begins. This allow to generate a file with absolutely all\nrecords found on the gridview.\n\n\n\u003e This project is currently under development. Any contribution is welcome.\n\n\n### Installation\n```\ncomposer require eseperio/yii2-exportable-gridview @dev\n```\n\n### Usage\n\nThis widget extends from yii2-gridview but add functionality to export\n**all the rows** queried by the DataProvider.\n\n\n```php\nuse eseperio\\gridview\\ExportableGridview as GridView;\n\u003c?= GridView::widget([\n        'dataProvider' =\u003e $dataProvider,\n        'filterModel' =\u003e $searchModel,\n        'columns' =\u003e [\n            ['class' =\u003e 'yii\\grid\\SerialColumn'],\n            'id',\n            'title',\n            'description',\n            'author',\n        ],\n    ]);\n    ?\u003e\n\n```\n\n### Additional configuration\n\n|Name|Type|default|Description|\n|----|----|-------|-----------|\n|`layout`|string|{summary} {items} {export} {pager}|In addition to default layout this gridview has `{export`} section. This is the place for export button.|\n|`fileName`|string|exported.xls|Name to use on the generated filename. If `writerType` value is not set then the writer will be guessed from the extension.|\n|`writerType`|string|null| The writer to be used when generating file. See [Spreadsheet writer](https://phpspreadsheet.readthedocs.io/en/develop/topics/reading-and-writing-to-file/). Accepts Xls, Xlsx, Ods, Csv, Html, Tcpdf, Dompdf, Mpdf|\n|`exportable`|boolean|true|Whether to enable export for this gridview |\n|`exportLinkOptions`|array| `['class'=\u003e 'btn btn-default', 'target'=\u003e'_blank']` |Options for the export link. It also accepts `label` and `encode`|\n|`exportColumns`|array|empty|Property to define a different column combination for export only. If empty default columns of gridview will be used|\n\n#### Constants available\nAll writers identifiers are available through constants.\n\n\n| Constant name | Value|\n|---------------|------|\n|`WRITER_XLS`|Xls|\n|`WRITER_XLSX`|Xlsx|\n|`WRITER_ODS`|Ods|\n|`WRITER_CSV`|Csv|\n|`WRITER_HTML`|Html|\n|`WRITER_TCPDF`|Tcpdf|\n|`WRITER_DOMPDF`|Dompdf|\n|`WRITER_MPDF`|Mpdf|\n\n\n### Notes\nAll html tags are removed when exporting.\n\n## Todo\n* [ ] Add option to exclude certain columns like ActionColumn.\n* [ ] Add batch data processing.\n* [ ] Add custom PDF export method.\n* [ ] Add tests\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feseperio%2Fyii2-exportable-gridview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feseperio%2Fyii2-exportable-gridview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feseperio%2Fyii2-exportable-gridview/lists"}