PHP Trait kartik\grid\ColumnTrait

Since: 1.0
Author: Kartik Visweswaran ([email protected])
Datei anzeigen Open project: kartik-v/yii2-grid

Public Methods

Method Description
parseExcelFormats ( array &$options, Model $model, mixed $key, integer $index ) Parses Excel Cell Formats for export
renderFilterCell ( ) : string Renders the filter cell.
renderHeaderCell ( ) : string Renders the header cell.
renderPageSummaryCell ( ) : string Renders the page summary cell.

Protected Methods

Method Description
calculateSummary ( ) : float Calculates the summary of an input data based on page summary aggregration function.
checkValidFilters ( ) Checks if the filter input types are valid
fetchContentOptions ( mixed $model, mixed $key, integer $index ) : array Parses and fetches updated content options for grid visibility and format
getColumnKey ( ) : mixed Generate an unique column key
getFooterCellContent ( ) : string Get the raw footer cell content.
getPageSummaryCellContent ( ) : string Gets the raw page summary cell content.
initGrouping ( ) : void Initializes grid grouping
initPjax ( string $script = '' ) Initialize column specific JS functionality whenever pjax request completes
isValidAlignment ( string $type = 'hAlign' ) : boolean Check if the alignment provided is valid
parseFormat ( ) Parses and formats a grid column
parseGrouping ( array &$options, Model $model, mixed $key, integer $index ) Parses grid grouping and sets data attributes
parseVal ( string | integer | Closur\Closure $var, Model $model, string | object $key, integer $index ) : mixed Parses a value if Closure and returns the right value
parseVisibility ( ) Checks hidden property and hides the column from display
renderPageSummaryCellContent ( ) : string Renders the page summary cell content.
setPageRows ( ) Store all rows for the column for the current page

Method Details

calculateSummary() protected method

Calculates the summary of an input data based on page summary aggregration function.
protected calculateSummary ( ) : float
return float

checkValidFilters() protected method

Checks if the filter input types are valid
protected checkValidFilters ( )

fetchContentOptions() protected method

Parses and fetches updated content options for grid visibility and format
protected fetchContentOptions ( mixed $model, mixed $key, integer $index ) : array
$model mixed the data model being rendered
$key mixed the key associated with the data model
$index integer the zero-based index of the data item among the item array returned by [[GridView::dataProvider]].
return array

getColumnKey() protected method

Generate an unique column key
protected getColumnKey ( ) : mixed
return mixed

getFooterCellContent() protected method

Get the raw footer cell content.
protected getFooterCellContent ( ) : string
return string the rendered result

getPageSummaryCellContent() protected method

Gets the raw page summary cell content.
protected getPageSummaryCellContent ( ) : string
return string the rendered result

initGrouping() protected method

Initializes grid grouping
protected initGrouping ( ) : void
return void

initPjax() protected method

Initialize column specific JS functionality whenever pjax request completes
protected initPjax ( string $script = '' )
$script string the js script to be used as a callback

isValidAlignment() protected method

Check if the alignment provided is valid
protected isValidAlignment ( string $type = 'hAlign' ) : boolean
$type string the alignment type
return boolean

parseExcelFormats() public method

Parses Excel Cell Formats for export
public parseExcelFormats ( array &$options, Model $model, mixed $key, integer $index )
$options array the HTML attributes for the cell
$model yii\base\Model the current model being rendered
$key mixed the primary key value for the model
$index integer the zero-based index of the model being rendered

parseFormat() protected method

Parses and formats a grid column
protected parseFormat ( )

parseGrouping() protected method

Parses grid grouping and sets data attributes
protected parseGrouping ( array &$options, Model $model, mixed $key, integer $index )
$options array
$model yii\base\Model
$key mixed
$index integer

parseVal() protected method

Parses a value if Closure and returns the right value
protected parseVal ( string | integer | Closur\Closure $var, Model $model, string | object $key, integer $index ) : mixed
$var string | integer | Closur\Closure the variable to parse
$model yii\base\Model the model instance
$key string | object the current model key value
$index integer the index of the current record in the data provider
return mixed

parseVisibility() protected method

Checks hidden property and hides the column from display
protected parseVisibility ( )

renderFilterCell() public method

Renders the filter cell.
public renderFilterCell ( ) : string
return string

renderHeaderCell() public method

Renders the header cell.
public renderHeaderCell ( ) : string
return string

renderPageSummaryCell() public method

Renders the page summary cell.
public renderPageSummaryCell ( ) : string
return string the rendered result

renderPageSummaryCellContent() protected method

Renders the page summary cell content.
protected renderPageSummaryCellContent ( ) : string
return string the rendered result

setPageRows() protected method

Store all rows for the column for the current page
protected setPageRows ( )