PHP 클래스 TbExtendedGridView

Features are: - Display an extended summary of the records shown. The extended summary can be configured to any of the {@link TbOperation} type of widgets. - Automatic chart display (using TbHighCharts widget), where user can 'switch' between views. - Selectable cells - Sortable rows
상속: extends TbGridView
파일 보기 프로젝트 열기: yinhe/yincart 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$afterSelectableCells a javascript function that will be invoked after a selection is done. The function signature is function(selected) where 'selected' refers to the selected columns.
$afterSortableUpdate a javascript function that will be invoked after a successful sorting is done. The function signature is function(id, position) where 'id' refers to the ID of the model id key, 'position' the new position in the list.
$bulkActionAlign the aligment of the bulk actions. It can be 'left' or 'right'.
$bulkActions the configuration options to display a TbBulkActions widget
$chartOptions array if configured, the extended view will display a highcharts chart.
$componentsAfterAjaxUpdate 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 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.
$extendedSummary 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.
 '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"
         )
     )
),
$extendedSummaryCssClass string is the class name of the layer containing the extended summary
$extendedSummaryOptions array the HTML attributes of the layer containing the extended summary
$fixedHeader boolean if set to true will keep the header fixed position
$headerOffset integer
$selectableCells whether to allow selecting of cells
$selectableCellsFilter 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.
$sortableAction Name of the action to call and sort values
$sortableAjaxSave Save sort order by ajax defaults to false
$sortableAttribute Database field name for row sorting
$sortableRows boolean
$template 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.

보호된 프로퍼티들

프로퍼티 타입 설명
$bulk component that will display the bulk actions to the grid
$displayChart boolean a helper property that is set to true if we have to render a chart.
$displayExtendedSummary boolean a helper property that is set to true if we have to render the extended summary
$extendedSummaryOperations array hold the supported operation types
$extendedSummaryTypes TbOperation[] hold the current configured TbOperation that will process column values.

공개 메소드들

메소드 설명
init ( ) ### .init()
registerCustomClientScript ( ) ### .registerCustomClientScript()
renderBulkActions ( ) ### .renderBulkActions()
renderChart ( ) ### .renderChart()
renderContent ( ) ### .renderContent()
renderExtendedSummary ( ) ### .renderExtendedSummary()
renderExtendedSummaryContent ( ) ### .renderExtendedSummaryContent()
renderKeys ( ) ### .renderKeys()
renderTableFooter ( ) ### .renderTableFooter()
renderTableHeader ( ) ### .renderTableHeader()
renderTableRow ( integer $row ) ### .renderTableRow()

보호된 메소드들

메소드 설명
getAttribute ( CActiveRecord $data, string $attribute ) : mixed ### .getAttribute()
getColumnByName ( string $name ) : CDataColumn | null ### .getColumnByName()
getPrimaryKey ( CActiveRecord $data ) : null | string ### .getPrimaryKey()
getSummaryOperationInstance ( string $name, array $config ) : mixed ### .getSummaryOperationInstance()
parseColumnValue ( CDataColumn $column, integer $row ) : string ### .parseColumnValue()

메소드 상세

getAttribute() 보호된 메소드

Helper function to get an attribute from the data
protected getAttribute ( CActiveRecord $data, string $attribute ) : mixed
$data CActiveRecord
$attribute string the attribute to get
리턴 mixed the attribute value null if none found

getColumnByName() 보호된 메소드

Helper function to get a column by its name
protected getColumnByName ( string $name ) : CDataColumn | null
$name string
리턴 CDataColumn | null

getPrimaryKey() 보호된 메소드

Helper function to return the primary key of the $data IMPORTANT: composite keys on CActiveDataProviders will return the keys joined by comma
protected getPrimaryKey ( CActiveRecord $data ) : null | string
$data CActiveRecord
리턴 null | string

getSummaryOperationInstance() 보호된 메소드

Each type of 'extended' summary
protected getSummaryOperationInstance ( string $name, array $config ) : mixed
$name string the name of the column
$config array the configuration of the column at the extendedSummary
리턴 mixed

init() 공개 메소드

Widget initialization
public init ( )

parseColumnValue() 보호된 메소드

### .parseColumnValue()
protected parseColumnValue ( CDataColumn $column, integer $row ) : string
$column CDataColumn
$row integer the current row number
리턴 string

registerCustomClientScript() 공개 메소드

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

renderBulkActions() 공개 메소드

### .renderBulkActions()
public renderBulkActions ( )

renderChart() 공개 메소드

Renders chart
public renderChart ( )

renderContent() 공개 메소드

Renders grid content
public renderContent ( )

renderExtendedSummary() 공개 메소드

Renders summary

renderExtendedSummaryContent() 공개 메소드

Renders summary content. Will be appended to

renderKeys() 공개 메소드

Renders the key values of the data in a hidden tag.
public renderKeys ( )

renderTableFooter() 공개 메소드

Renders the table footer.
public renderTableFooter ( )

renderTableHeader() 공개 메소드

Renders grid header
public renderTableHeader ( )

renderTableRow() 공개 메소드

Renders a table body row.
public renderTableRow ( integer $row )
$row integer the row number (zero-based).

프로퍼티 상세

$afterSelectableCells 공개적으로 프로퍼티

a javascript function that will be invoked after a selection is done. The function signature is function(selected) where 'selected' refers to the selected columns.
public $afterSelectableCells

$afterSortableUpdate 공개적으로 프로퍼티

a javascript function that will be invoked after a successful sorting is done. The function signature is function(id, position) where 'id' refers to the ID of the model id key, 'position' the new position in the list.
public $afterSortableUpdate

$bulk 보호되어 있는 프로퍼티

component that will display the bulk actions to the grid
protected $bulk

$bulkActionAlign 공개적으로 프로퍼티

the aligment of the bulk actions. It can be 'left' or 'right'.
public $bulkActionAlign

$bulkActions 공개적으로 프로퍼티

the configuration options to display a TbBulkActions widget
또한 보기: TbBulkActions widget for its configuration
public $bulkActions

$chartOptions 공개적으로 프로퍼티

if configured, the extended view will display a highcharts chart.
public array $chartOptions
리턴 array

$componentsAfterAjaxUpdate 공개적으로 프로퍼티

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.
public array $componentsAfterAjaxUpdate
리턴 array

$componentsReadyScripts 공개적으로 프로퍼티

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.
public array $componentsReadyScripts
리턴 array

$displayChart 보호되어 있는 프로퍼티

a helper property that is set to true if we have to render a chart.
protected bool $displayChart
리턴 boolean

$displayExtendedSummary 보호되어 있는 프로퍼티

a helper property that is set to true if we have to render the extended summary
protected bool $displayExtendedSummary
리턴 boolean

$extendedSummary 공개적으로 프로퍼티

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.
 '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"
         )
     )
),
public array $extendedSummary
리턴 array

$extendedSummaryCssClass 공개적으로 프로퍼티

is the class name of the layer containing the extended summary
public string $extendedSummaryCssClass
리턴 string

$extendedSummaryOperations 보호되어 있는 프로퍼티

hold the supported operation types
protected array $extendedSummaryOperations
리턴 array

$extendedSummaryOptions 공개적으로 프로퍼티

the HTML attributes of the layer containing the extended summary
public array $extendedSummaryOptions
리턴 array

$extendedSummaryTypes 보호되어 있는 프로퍼티

hold the current configured TbOperation that will process column values.
protected TbOperation[] $extendedSummaryTypes
리턴 TbOperation[]

$fixedHeader 공개적으로 프로퍼티

if set to true will keep the header fixed position
public bool $fixedHeader
리턴 boolean

$headerOffset 공개적으로 프로퍼티

public int $headerOffset
리턴 integer

$selectableCells 공개적으로 프로퍼티

whether to allow selecting of cells
public $selectableCells

$selectableCellsFilter 공개적으로 프로퍼티

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.
public $selectableCellsFilter

$sortableAction 공개적으로 프로퍼티

Name of the action to call and sort values
public $sortableAction

$sortableAjaxSave 공개적으로 프로퍼티

Save sort order by ajax defaults to false
public $sortableAjaxSave

$sortableAttribute 공개적으로 프로퍼티

Database field name for row sorting
public $sortableAttribute

$sortableRows 공개적으로 프로퍼티

public bool $sortableRows
리턴 boolean

$template 공개적으로 프로퍼티

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.
public $template