Property |
Type |
Description |
|
$afterSaveView |
|
the view file to show details of exported file link. This property will be validated only when
$stream is false and streamAfterSave is false. You can set this to false to not display any file
link details for view. This defaults to the _view PHP file in the views folder of the extension. |
|
$asDropdown |
|
whether to render the export menu as bootstrap button dropdown widget. Defaults to true. If set to
false, this will generate a simple HTML list of links. |
|
$autoWidth |
|
whether to auto-size the excel output column widths. Defaults to true. |
|
$batchSize |
|
fetch models from the dataprovider using batches of this size. Set this to 0 (the default) to
disable. If $dataProvider does not have a pagination object, this parameter is ignored. Setting this
property helps reduce memory overflow issues by allowing parsing of models in batches, rather than fetching
all models in one go. |
|
$clearBuffers |
|
whether to clear all previous / parent buffers. Defaults to false. |
|
$columnBatchToggleSettings |
|
the settings for the toggle all checkbox to check / uncheck the columns as a batch. Should be setup as
an associative array which can have the following keys:
- show: bool, whether the batch toggle checkbox is to be shown. Defaults to true.
- label: string, the label to be displayed for toggle all. Defaults to Toggle All.
- options: array, the HTML attributes for the toggle label text. Defaults to ['class'=>'kv-toggle-all'] |
|
$columnSelector |
|
the configuration of the column names in the column selector. Note: column names will be generated
automatically by default. Any setting in this property will override the auto-generated column names. This
list should be setup as $key => $value where:
$key: int, is the zero based index of the column as set in $columns.
$value: string, is the column name/label you wish to display in the column selector. |
|
$columnSelectorMenuOptions |
|
the HTML attributes for the column selector menu list. |
|
$columnSelectorOptions |
|
the HTML attributes for the column selector dropdown button. The following special options are
recognized:
- label: string, defaults to empty string.
- icon: string, defaults to
- title: string, defaults to Select columns for export. |
|
$container |
|
|
|
$contentAfter |
|
an array of rows to append after the footer row. Each array
should be set with the following settings:
- value: string, the value of the merged row
- styleOptions: array, array of configuration options to set the style. See $styleOptions on how to configure. |
|
$contentBefore |
|
an array of rows to prepend in front of the grid used to create things like a title. Each array
should be set with the following settings:
- value: string, the value of the merged row
- styleOptions: array, array of configuration options to set the style. See $styleOptions on how to configure. |
|
$deleteAfterSave |
|
whether to delete file after saving file to $folder and when $stream is false. This property
will be validated only when $stream is false. This property is useful only if streamAfterSave is
true. |
|
$disabledColumns |
|
the column indexes for export that will be disabled for selection in the column selector. |
|
$docProperties |
|
the PHPExcel document properties |
|
$dropdownOptions |
|
the HTML attributes for the export button menu. Applicable only if asDropdown is set to true. The
following special options are available:
- label: string, defaults to empty string
- icon: string, defaults to
- title: string, defaults to Export data in selected format.
- menuOptions: array, the HTML attributes for the dropdown menu.
- itemsBefore: array, any additional items that will be merged/prepended before with the export dropdown list.
This should be similar to the items property as supported by \yii\bootstrap\ButtonDropdown widget. Note
the page export items will be automatically generated based on settings in the exportConfig property.
- itemsAfter: array, any additional items that will be merged/appended after with the export dropdown list. This
should be similar to the items property as supported by \yii\bootstrap\ButtonDropdown widget. Note the
page export items will be automatically generated based on settings in the exportConfig property. |
|
$dynagrid |
|
enable dynagrid for column selection. If set to true the inbuilt export menu column selector
functionality will be disabled and not rendered. |
|
$dynagridOptions |
|
dynagrid widget options |
|
$enableFormatter |
|
whether to enable the yii gridview formatter component. Defaults to true. If set to false, this
will render content as raw format. |
|
$encoding |
|
encoding for the downloaded file header. Defaults to 'utf-8'. |
|
$exportColumnsView |
|
the view file for rendering the columns selection |
|
$exportConfig |
|
the export configuration. The array keys must be the one of the format constants (CSV, HTML, TEXT,
EXCEL, PDF) and the array value is a configuration array consisting of these settings:
- label: string, the label for the export format menu item displayed
- icon: string, the glyphicon or font-awesome name suffix to be displayed before the export menu item label. If
set to an empty string, this will not be displayed.
- iconOptions: array, HTML attributes for export menu icon.
- linkOptions: array, HTML attributes for each export item link.
- filename: the base file name for the generated file. Defaults to 'grid-export'. This will be used to generate
a default file name for downloading.
- extension: the extension for the file name
- alertMsg: string, the message prompt to show before saving. If this is empty or not set it will not be
displayed.
- mime: string, the mime type (for the file format) to be set before downloading.
- writer: string, the PHP Excel writer type
- options: array, HTML attributes for the export menu item. |
|
$exportFormOptions |
|
the HTML attributes for the export form. |
|
$exportFormView |
|
the view file for rendering the export form |
|
$exportRequestParam |
|
the request parameter ($_GET or $_POST) that will be submitted during export. If not set this will
be auto generated. This should be unique for each export menu widget (for multiple export menu widgets on
same page). |
|
$filename |
|
the exported output file name. Defaults to 'grid-export'; |
|
$folder |
|
the folder to save the exported file. Defaults to '@webroot/tmp/'. This property will be parsed only
if stream is false. If the specified folder does not exist, files will be saved to @webroot. |
|
$fontAwesome |
|
whether to use font awesome icons for rendering the icons as defined in exportConfig. If set to
true, you must load the FontAwesome CSS separately in your application. |
|
$groupedRowStyle |
|
the default style configuration |
|
$hiddenColumns |
|
the column indexes for export that will be hidden for selection in the column selector, but will
still be displayed in export output. |
|
$i18n |
|
the internalization configuration for this widget |
|
$initProvider |
|
whether to initialize data provider and clear models before rendering. Defaults to false. |
|
$krajeeDialogSettings |
|
configuration settings for the Krajee dialog widget that will be used to render alerts and
confirmation dialog prompts |
|
$linkPath |
|
the web accessible path for the saved file location. This property will be parsed only if stream
is false. Note the afterSaveView property that will render the displayed file link. |
|
$messages |
|
|
|
$noExportColumns |
|
the column indexes for export that will not be exported at all nor will they be shown in the column
selector |
|
$onInitExcel |
|
the callback function on initializing the PHP Excel library. The anonymous function should have the
following signature:
php
function ($excel, $grid)
where:
- $excel: the PHPExcel object instance
- $grid: the GridView object |
|
$onInitSheet |
|
the callback function to be executed on initializing the active sheet. The anonymous function
should have the following signature:
php
function ($sheet, $grid)
where:
- $sheet: PHPExcel_Worksheet, the PHPExcel_Worksheet object instance
- $grid: GridView, the current GridView object |
|
$onInitWriter |
|
the callback function on initializing the writer. The anonymous function should have the following
signature:
php
function ($writer, $grid)
where:
- $writer: PHPExcel_Writer_Abstract, the PHPExcel_Writer_Abstract object instance
- $grid: GridView, the current GridView object |
|
$onRenderDataCell |
|
the callback function to be executed on rendering each body data cell content. The anonymous
function should have the following signature:
php
function ($cell, $content, $model, $key, $index, $grid)
where:
- $cell: PHPExcel_Cell, the current PHPExcel cell being rendered
- $content: string, the data cell content being rendered
- $model: Model, the data model to be rendered
- $key: mixed, the key associated with the data model
- $index: int, the zero-based index of the data model among the model array returned by [[dataProvider]].
- $grid: GridView, the current GridView object |
|
$onRenderFooterCell |
|
the callback function to be executed on rendering the footer cell output content. The anonymous
function should have the following signature:
php
function ($cell, $content, $grid)
where:
- $sheet: PHPExcel_Worksheet, the PHPExcel_Worksheet object instance
- $content: string, the footer cell content being rendered
- $grid: GridView, the current GridView object |
|
$onRenderHeaderCell |
|
the callback function to be executed on rendering the header cell output content. The anonymous
function should have the following signature:
php
function ($cell, $content, $grid)
where:
- $cell: PHPExcel_Cell, is the current PHPExcel cell being rendered
- $content: string, is the header cell content being rendered
- $grid: GridView, the current GridView object |
|
$onRenderSheet |
|
the callback function to be executed on rendering the sheet. The anonymous function should have the
following signature:
php
function ($sheet, $grid)
where:
- $sheet: PHPExcel_Worksheet, the PHPExcel_Worksheet object instance
- $grid: GridView, the current GridView object |
|
$pdfLibrary |
|
the library used to render the PDF. Defaults to 'mPDF'. Must be one of:
- PHPExcel_Settings::PDF_RENDERER_TCPDF or 'tcPDF'
- PHPExcel_Settings::PDF_RENDERER_DOMPDF or 'DomPDF'
- PHPExcel_Settings::PDF_RENDERER_MPDF or 'mPDF' |
|
$pdfLibraryPath |
|
the alias for the pdf library path to export to PDF |
|
$pjaxContainerId |
|
the pjax container identifier inside which this menu is being rendered. If set the jQuery export
menu plugin will get auto initialized on pjax request completion. |
|
$selectedColumns |
|
the selected column indexes for export. If not set this will default to all columns. |
|
$showColumnSelector |
|
whether to show a column selector to select columns for export. Defaults to true. |
|
$showConfirmAlert |
|
whether to show a confirmation alert dialog before download. This confirmation dialog will notify user
about the type of exported file for download and to disable popup blockers. Defaults to true. |
|
$stream |
|
whether to stream output to the browser. |
|
$streamAfterSave |
|
whether to stream after saving file to $folder and when $stream is false. This property will be
validated only when $stream is false. |
|
$styleOptions |
|
the output style configuration options. It must be the style configuration array as required by
PHPExcel. |
|
$target |
|
the target for submitting the export form, which will trigger the download of the exported file.
Must be one of the TARGET_ constants. Defaults to ExportMenu::TARGET_POPUP. Note if you set stream and
streamAfterSave to false, then this will be overridden to _self. |
|
$template |
|
|
|
$timeout |
|
timeout for the export function (in seconds), if timeout is < 0, the default PHP timeout will be used. |
|