Yii2 GridView on steroids. A module with various modifications and enhancements to one of the most used widgets by Yii developers. The widget contains new additional Grid Columns with enhanced settings for Yii Framework 2.0. The widget also incorporates various Bootstrap 3.x styling options. Refer detailed documentation and/or a complete demo.
The latest version of the module is v2.7.0 released on 01-Dec-2014. Refer the CHANGE LOG for details.
New features in release 2.7.0.
ExpandRowColumnhas been added which allows one to expand grid rows, show details, or load content via ajax. Check the ExpandRowColumn documentation for further details. The features available with this column are:
detailproperty). This can be set as a HTML markup directly or via Closure callback using column parameters.
detailUrlproperty directly or via a Closure callback using column parameters.
pageSummaryOptionsto prepend/append content to page summary.
Note: This extension depends on other yii2 extensions based on the functionality chosen by you. It will not install such dependent packages by default, but will prompt through an exception, if accessed. For example, if you choose to enable PDF export, then the yii2-mpdf will be mandatory and exception will be raised if
yii2-mpdfis not installed. Check the composer.json for other extension dependencies.
Refer the CHANGE LOG for details.
The extension has been created as a module to enable access to advanced features like download actions (exporting as csv, text, html, or xls). You should configure the module with a name of
gridview as shown below:
'modules' => [
'gridview' => [
'class' => '\kartik\grid\Module'
The following functionalities have been added/enhanced:
Control various options to style your grid table. Added
containerOptions to customize your grid table container. Enhancements for grid and columns to work with yii\widgets\Pjax.
Inbuilt support for Pjax. Enhancements for grid and columns to work with
pjax property to enable pjax and
pjaxSettings to customize the pjax behavior.
Add custom header or footer rows, above / below your default grid header and footer.
Allows the grid table to have a floating table header. Uses the JQuery Float THead plugin to display a seamless floating table header.
Allows configuration of GridView to be enclosed in a panel that can be styled as per Bootstrap 3.x. The panel will enable configuration of various sections to embed content/buttons, before and after header, and before and after footer.
The grid offers ability to configure toolbar for adding various actions. The default templates place the toolbar in the
before section of the
panel. The toolbar is by default styled using Bootstrap button groups. Some of the default actions like the
export button is by default appended to the toolbar.
With version v2.1.0, if you are using the
yii2-dynagrid extension it automatically displays the personalize, sort, and filter buttons in the toolbar. The toolbar can be configured as a simple array. Refer the docs and demos for details.
The grid now offers ability to plugin dynamic content to your grid at runtime. A new property
replaceTags has been added with v2.3.0. This allows you to specify tags which will be replaced dynamically at grid rendering time and wherever you set these tags in any of the grid layout templates.
This is a new feature added to the GridView widget. The page summary is an additional row above the footer - for displaying the summary/totals for the current GridView page. The following parameters are applicable to control this behavior:
showPageSummary: boolean whether to display the page summary row for the grid view. Defaults to
pageSummaryRowOptions: array, HTML attributes for the page summary row. Defaults to
['class' => 'kv-page-summary warning'].
This is a new feature added to the GridView widget. It allows you to export the displayed grid content as HTML, CSV, TEXT, EXCEL, PDF, & JSON. It uses the rendered grid data on client to convert to one of the format specified using JQuery. This is supported across all browsers. The PDF rendering is achieved through a separate extension yii2-mpdf.
Features offered by yii2-grid export:
exportConversionsthat can be setup in GridView. For example, this currently is set as a default to convert the HTML formatted icons for BooleanColumn to user friendly text like
skip-export: Will skip this element during export for all formats (
skip-export-html: Will skip this element during export only for
skip-export-csv: Will skip this element during export only for
skip-export-txt: Will skip this element during export only for
skip-export-xls: Will skip this element during export only for
xls(excel) export format.
skip-export-pdf: Will skip this element during export only for
skip-export-json: Will skip this element during export only for
jsonexport format. These CSS can be set virtually anywhere. For example
hiddenFromExportproperty, but show them in normal on screen display.
This extension (with v2.3.0) adds ability to toggle between viewing all grid data and paginated data. By default the grid displays paginated data. This can be used for exporting complete grid data.
The default Yii data column has been enhanced with various additional parameters. Refer documentation for details.
An enhanced data column that allows one to expand a grid row and display additional/detail content in a new row below it either directly or via ajax. Refer documentation for details.
This is a new grid column class that extends the \kartik\grid\DataColumn class. It allows calculating formulae just like in spreadsheets - based on values of other columns in the grid. The formula calculation is done at grid rendering runtime and does not need to query the database. Hence you can use formula columns within another formula column. Refer documentation for details.
This is a new grid column class that extends the \kartik\grid\DataColumn class. It automatically converts boolean data (true/false) values to user friendly indicators or labels (that are configurable). Refer documentation for details. The following are new features added since release v1.6.0:
BooleanColumnicons have been setup as
ICON_INACTIVEconstants in GridView.
\yii\grid\ActionColumn to include optional dropdown Action menu and work with the new pageSummary and a default styling to work for many scenarios. Refer documentation for details.
The following are new features added since release v1.6.0:
ActionColumn content by default has been disabled to appear in export output. The
skip-export CSS class has been set as default in
\yii\grid\SerialColumn to work with the new pageSummary and a default styling to work for many scenarios. Refer documentation for details.
\yii\grid\CheckboxColumn to work with the new pageSummary and a default styling to work for many scenarios. Refer documentation for details.
Note: This extension mandatorily requires Yii Framework 2. The framework is under active development and the first stable release of Yii 2 is expected in early 2014.
The preferred way to install this extension is through composer.
$ php composer.phar require kartik-v/yii2-grid "dev-master"
require section of your
yii2-grid is released under the BSD 3-Clause License. See the bundled
LICENSE.md for details.