Constants

TYPE_STRIPED

TYPE_STRIPED

TYPE_BORDERED

TYPE_BORDERED

TYPE_CONDENSED

TYPE_CONDENSED

TYPE_HOVER

TYPE_HOVER

Properties

$type

$type : string|array

Type

string|array — the table type. Valid values are 'striped', 'bordered', 'condensed' and/or 'hover'.

$pagerCssClass

$pagerCssClass : string

Type

string — the CSS class name for the pager container. Defaults to 'pagination'.

$pager

$pager : array

Type

array — the configuration for the pager. Defaults to <code>array('class'=>'ext.booster.widgets.TbPager')</code>.

$cssFile

$cssFile : string

Type

string — the URL of the CSS file used by this grid view. Defaults to false, meaning that no CSS will be included.

$responsiveTable

$responsiveTable : bool

Type

bool — whether to make the grid responsive

$extraParams

$extraParams : array

Type

array — of additional parameters to pass to values

$fixedHeader

$fixedHeader : bool

Type

bool — if set to true will keep the header fixed position

$headerOffset

$headerOffset : integer

Type

integer — when $fixedHeader is set to true, headerOffset will position table header top position at $headerOffset. If you are using bootstrap and has navigation top fixed, its height is 40px, so it is recommended to use $headerOffset=40;

$template

$template : string

Type

string — the template to be used to control the layout of various sections in the view. These tokens are recognized: {extendedSummary}, {summary}, {items} and {pager}. They will be replaced with the extended summary, summary text, the items, and the pager.

$extendedSummary

$extendedSummary : array

Type

array — displays an extended summary version. There are different types of summary types, please, see {@link TbSumOperation}, {@link TbSumOfTypeOperation},{@link TbPercentOfTypeGooglePieOperation} {@link TbPercentOfTypeOperation} and {@link TbPercentOfTypeEasyPieOperation}. The following is an example, please review the different types of TbOperation classes to find out more about its configuration parameters. <pre> 'extendedSummary' => array( 'title' => '', // the extended summary title 'columns' => array( // the 'columns' that will be displayed at the extended summary 'id' => array( // column name "id" 'class' => 'TbSumOperation', // what is the type of TbOperation we are going to display 'label' => 'Sum of Ids' // label is name of label of the resulted value (ie Sum of Ids:) ), 'results' => array( // column name "results" 'class' => 'TbPercentOfTypeGooglePieOperation', // the type of TbOperation 'label' => 'How Many Of Each? ', // the label of the operation 'types' => array( // TbPercentOfTypeGooglePieOperation "types" attributes '0' => array('label' => 'zeros'), // a value of "0" will be labelled "zeros" '1' => array('label' => 'ones'), // a value of "1" will be labelled "ones" '2' => array('label' => 'twos')) // a value of "2" will be labelled "twos" ) ) ), </pre>

$extendedSummaryCssClass

$extendedSummaryCssClass : string

Type

string — is the class name of the layer containing the extended summary

$extendedSummaryOptions

$extendedSummaryOptions : array

Type

array — the HTML attributes of the layer containing the extended summary

$componentsAfterAjaxUpdate

$componentsAfterAjaxUpdate : array

Type

array — has scripts that will be executed after components have updated. It is used internally to render scripts required for components to work correctly. You may use it for your own scripts, just make sure it is of type array.

$componentsReadyScripts

$componentsReadyScripts : array

Type

array — hold scripts that will be executed on document ready. It is used internally to render scripts required for components to work correctly. You may use it for your own scripts, just make sure it is of type array.

$chartOptions

$chartOptions : array

Type

array — if configured, the extended view will display a highcharts chart.

$sortableRows

$sortableRows : bool

Type

bool — If true the rows at the table will be sortable.

$sortableAttribute

$sortableAttribute : string

Type

string — Database field name for row sorting

$sortableAjaxSave

$sortableAjaxSave : boolean

Type

boolean — Save sort order by ajax defaults to false

$afterSortableUpdate

$afterSortableUpdate : string

Type

string — a javascript function that will be invoked after a successful sorting is done. The function signature is <code>function(id, position)</code> where 'id' refers to the ID of the model id key, 'position' the new position in the list.

$selectableCells

$selectableCells : bool

Type

bool — whether to allow selecting of cells

$selectableCellsFilter

$selectableCellsFilter : string

Type

string — the filter to use to allow selection. For example, if you set the "htmlOptions" property of a column to have a "class" of "tobeselected", you could set this property as: "td.tobeselected" in order to allow selection to those columns with that class only.

$afterSelectableCells

$afterSelectableCells : string

Type

string — a javascript function that will be invoked after a selection is done. The function signature is <code>function(selected)</code> where 'selected' refers to the selected columns.

$bulkActions

$bulkActions : array

Type

array — the configuration options to display a TbBulkActions widget

$bulkActionAlign

$bulkActionAlign : string

Type

string — the aligment of the bulk actions. It can be 'left' or 'right'.

$dataProvider

$dataProvider : \CActiveDataProvider

the data provider for the view.

Type

\CActiveDataProvider

$columns

$columns : \TbDataColumn[]

Type

\TbDataColumn[]

$dataProvider

$dataProvider : \CActiveDataProvider

the data provider for the view.

Type

\CActiveDataProvider

$bulk

$bulk : \TbBulkActions

Type

\TbBulkActions — component that will display the bulk actions to the grid

$displayExtendedSummary

$displayExtendedSummary : boolean

Type

boolean — a helper property that is set to true if we have to render the extended summary

$displayChart

$displayChart : boolean

Type

boolean — a helper property that is set to true if we have to render a chart.

$extendedSummaryTypes

$extendedSummaryTypes : \TbOperation[]

Type

\TbOperation[] — hold the current configured TbOperation that will process column values.

$extendedSummaryOperations

$extendedSummaryOperations : array

Type

array — hold the supported operation types

Methods

init()

init()

### .init()

Widget initialization

renderContent()

renderContent()

### .renderContent()

Renders grid content

renderKeys()

renderKeys()

### .renderKeys()

Renders the key values of the data in a hidden tag.

renderTableHeader()

renderTableHeader()

### .renderTableHeader()

Renders grid header

renderTableFooter()

renderTableFooter()

### .renderTableFooter()

Renders the table footer.

renderBulkActions()

renderBulkActions()

### .renderBulkActions()

renderChart()

renderChart()

### .renderChart()

Renders chart

Throws

\CException

renderTableRow()

renderTableRow(integer $row)

### .renderTableRow()

Renders a table body row.

Parameters

integer $row

the row number (zero-based).

renderExtendedSummary()

renderExtendedSummary()

### .renderExtendedSummary()

Renders summary

renderExtendedSummaryContent()

renderExtendedSummaryContent()

### .renderExtendedSummaryContent()

Renders summary content. Will be appended to

registerCustomClientScript()

registerCustomClientScript()

### .registerCustomClientScript()

This script must be run at the end of content rendering not at the beginning as it is common with normal CGridViews

initColumns()

initColumns()

### .initColumns()

Creates column objects and initializes them.

createDataColumn()

createDataColumn(mixed $text) : \TbDataColumn|\CDataColumn

### .createDataColumn()

Creates a column based on a shortcut column specification string.

Parameters

mixed $text

the column specification string

Throws

\CException

if the column format is incorrect

Returns

\TbDataColumn|\CDataColumn —

the column instance

writeResponsiveCss()

writeResponsiveCss()

### .writeResponsiveCss()

Writes responsiveCSS

getAttribute()

getAttribute(\CActiveRecord $data, string $attribute) : mixed

### .getAttribute()

Helper function to get an attribute from the data

Parameters

\CActiveRecord $data
string $attribute

the attribute to get

Returns

mixed —

the attribute value null if none found

getPrimaryKey()

getPrimaryKey(\CActiveRecord $data) : null|string

### .getPrimaryKey()

Helper function to return the primary key of the $data IMPORTANT: composite keys on CActiveDataProviders will return the keys joined by comma

Parameters

\CActiveRecord $data

Returns

null|string

parseColumnValue()

parseColumnValue(\CDataColumn $column, integer $row) : string

### .parseColumnValue()

Parameters

\CDataColumn $column
integer $row

the current row number

Returns

string

getSummaryOperationInstance()

getSummaryOperationInstance(string $name, array $config) : mixed

### .getSummaryOperationInstance()

Each type of 'extended' summary

Parameters

string $name

the name of the column

array $config

the configuration of the column at the extendedSummary

Throws

\CException

Returns

mixed

getColumnByName()

getColumnByName(string $name) : \CDataColumn|null

### .getColumnByName()

Helper function to get a column by its name

Parameters

string $name

Returns

\CDataColumn|null