PHP Trait kartik\grid\ColumnTrait

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

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

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

checkValidFilters() protected méthode

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

fetchContentOptions() protected méthode

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]].
Résultat array

getColumnKey() protected méthode

Generate an unique column key
protected getColumnKey ( ) : mixed
Résultat mixed

getFooterCellContent() protected méthode

Get the raw footer cell content.
protected getFooterCellContent ( ) : string
Résultat string the rendered result

getPageSummaryCellContent() protected méthode

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

initGrouping() protected méthode

Initializes grid grouping
protected initGrouping ( ) : void
Résultat void

initPjax() protected méthode

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 méthode

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

parseExcelFormats() public méthode

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 méthode

Parses and formats a grid column
protected parseFormat ( )

parseGrouping() protected méthode

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 méthode

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
Résultat mixed

parseVisibility() protected méthode

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

renderFilterCell() public méthode

Renders the filter cell.
public renderFilterCell ( ) : string
Résultat string

renderHeaderCell() public méthode

Renders the header cell.
public renderHeaderCell ( ) : string
Résultat string

renderPageSummaryCell() public méthode

Renders the page summary cell.
public renderPageSummaryCell ( ) : string
Résultat string the rendered result

renderPageSummaryCellContent() protected méthode

Renders the page summary cell content.
protected renderPageSummaryCellContent ( ) : string
Résultat string the rendered result

setPageRows() protected méthode

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