YiiWheels
  • Package
  • Class
  • Tree

Packages

  • None
  • yiiwheels
    • behaviors
    • widgets
    • widgets
      • ace
      • box
      • datepicker
      • daterangepicker
      • datetimepicker
      • detail
      • fileupload
      • fileuploader
      • gallery
      • google
      • grid
        • behaviors
        • operations
      • highcharts
      • maskInput
      • maskmoney
      • modal
      • multiselect
      • rangeslider
      • redactor
      • select2
      • sparklines
      • switch
      • timeago
      • timepicker
      • toggle
      • typeahead

Classes

  • WhGridView
  • WhGroupGridView
  • WhImageColumn
  • WhRelationalColumn

Class WhGridView

TbGridView
Extended by WhGridView
Package: YiiWheels\widgets\grid
Copyright: Copyright © 2amigos.us 2013-
License: New BSD License
Author: Antonio Ramirez <amigo.cobos@gmail.com>
Located at widgets/grid/WhGridView.php

Methods summary

public
# init( )

Widget initialization

Widget initialization

public
# renderContent( )

Renders grid content

Renders grid content

protected mixed
# getAttribute( CActiveRecord $data, string $attribute )

Helper function to get an attribute from the data

Helper function to get an attribute from the data

Parameters

$data
CActiveRecord
$data
$attribute
string
$attribute the attribute to get

Returns

mixed
the attribute value null if none found
protected null|string
# getPrimaryKey( CActiveRecord $data )

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

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

Parameters

$data
CActiveRecord
$data

Returns

null|string
public
# renderTableHeader( )

Renders grid header

Renders grid header

public
# renderTableFooter( )

Renders the table footer.

Renders the table footer.

public
# renderTableRow( integer $row )

Renders a table body row.

Renders a table body row.

Parameters

$row
integer
$row the row number (zero-based).
public
# renderExtendedSummary( )

Renders summary

Renders summary

public
# renderExtendedSummaryContent( )

Renders summary content. Will be appended to

Renders summary content. Will be appended to

public
# registerCustomClientScript( )

Registers required css, js and scripts Note: This script must be run at the end of content rendering not at the beginning as it is common with normal CGridViews

Registers required css, js and scripts Note: This script must be run at the end of content rendering not at the beginning as it is common with normal CGridViews

public CDataColumn|null
# getColumnByName( string $name )

Helper function to get a column by its name

Helper function to get a column by its name

Parameters

$name
string
$name

Returns

CDataColumn|null
protected
# initColumns( )

Creates column objects and initializes them.

Creates column objects and initializes them.

protected string
# parseColumnValue( CDataColumn $column, integer $row )

Parses the value of a column by an operation

Parses the value of a column by an operation

Parameters

$column
CDataColumn
$column
$row
integer
$row the current row number

Returns

string
protected mixed
# getSummaryOperationInstance( string $name, array $config )

Each type of 'extended' summary

Each type of 'extended' summary

Parameters

$name
string
$name the name of the column
$config
array
$config the configuration of the column at the extendedSummary

Returns

mixed

Throws

CException

Magic methods summary

Properties summary

public boolean $fixedHeader
#

$fixedHeader if set to true will keep the header fixed position

$fixedHeader if set to true will keep the header fixed position

public integer $headerOffset
#

$headerOffset, 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;

$headerOffset, 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;

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

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 array $extendedSummary
#

$extendedSummary displays an extended summary version. There are different types of summary types, please, see TbSumOperation, TbSumOfTypeOperation,TbPercentOfTypeGooglePieOperation TbPercentOfTypeOperation and 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"
         )
     )
),

$extendedSummary displays an extended summary version. There are different types of summary types, please, see TbSumOperation, TbSumOfTypeOperation,TbPercentOfTypeGooglePieOperation TbPercentOfTypeOperation and 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 string $extendedSummaryCssClass
#

$extendedSummaryCssClass is the class name of the layer containing the extended summary

$extendedSummaryCssClass is the class name of the layer containing the extended summary

public array $extendedSummaryOptions
#

$extendedSummaryOptions the HTML attributes of the layer containing the extended summary

$extendedSummaryOptions the HTML attributes of the layer containing the extended summary

public array $componentsAfterAjaxUpdate
#

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

$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 $componentsReadyScripts
#

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

$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 $chartOptions
#

$chartOptions if configured, the extended view will display a highcharts chart.

$chartOptions if configured, the extended view will display a highcharts chart.

public boolean $responsiveTable
#

whether to make the grid responsive

whether to make the grid responsive

protected boolean $displayExtendedSummary
#

$displayExtendedSummary a helper property that is set to true if we have to render the extended summary

$displayExtendedSummary a helper property that is set to true if we have to render the extended summary

protected WhOperation[] $extendedSummaryTypes
#

$extendedSummaryTypes hold the current configured TbOperation that will process column values.

$extendedSummaryTypes hold the current configured TbOperation that will process column values.

protected array $extendedSummaryOperations
#

$extendedSummaryOperations hold the supported operation types

$extendedSummaryOperations hold the supported operation types

YiiWheels API documentation generated by ApiGen 2.8.0