Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CBaseListView
  • CBreadcrumbs
  • CDetailView
  • CListView
  • CMenu
  • CPortlet
  • MobileActivityFeedListView
  • RecordIndexListView
  • TopicsListView
  • Overview
  • Package
  • Class
  • Tree

Class CBaseListView

CBaseListView is the base class for CListView and CGridView.

CBaseListView implements the common features needed by a view wiget for rendering multiple models.

CComponent
Extended by CBaseController
Extended by CWidget
Extended by CBaseListView

Direct known subclasses

CGridView, CListView

Indirect known subclasses

InlineRelationshipsGridView, MobileActivityFeedListView, X2ListView, RecordIndexListView, TopicsListView, X2ActiveGridView, X2ActiveGridViewForSortableWidgets, X2GridView, X2GridViewBase, X2GridViewForSortableWidgets, X2GridViewGeneric
Abstract
Package: zii\widgets
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.1
Located at x2engine/framework/zii/widgets/CBaseListView.php
Methods summary
public
# init( )

Initializes the view. This method will initialize required property values and instantiate columns objects.

Initializes the view. This method will initialize required property values and instantiate columns objects.

Overrides

CWidget::init()
public
# run( )

Renders the view. This is the main entry of the whole view rendering. Child classes should mainly override CBaseListView::renderContent() method.

Renders the view. This is the main entry of the whole view rendering. Child classes should mainly override CBaseListView::renderContent() method.

Overrides

CWidget::run()
public
# renderContent( )

Renders the main content of the view. The content is divided into sections, such as summary, items, pager. Each section is rendered by a method named as "renderXyz", where "Xyz" is the section name. The rendering results will replace the corresponding placeholders in CBaseListView::$template.

Renders the main content of the view. The content is divided into sections, such as summary, items, pager. Each section is rendered by a method named as "renderXyz", where "Xyz" is the section name. The rendering results will replace the corresponding placeholders in CBaseListView::$template.

protected string
# renderSection( array $matches )

Renders a section. This method is invoked by CBaseListView::renderContent() for every placeholder found in CBaseListView::$template. It should return the rendering result that would replace the placeholder.

Renders a section. This method is invoked by CBaseListView::renderContent() for every placeholder found in CBaseListView::$template. It should return the rendering result that would replace the placeholder.

Parameters

$matches
array
$matches the matches, where $matches[0] represents the whole placeholder, while $matches[1] contains the name of the matched placeholder.

Returns

string
the rendering result of the section
public
# renderEmptyText( )

Renders the empty message when there is no data.

Renders the empty message when there is no data.

public
# renderKeys( )

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

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

public
# renderSummary( )

Renders the summary text.

Renders the summary text.

public
# renderPager( )

Renders the pager.

Renders the pager.

public
# registerClientScript( )

Registers necessary client scripts. This method is invoked by CBaseListView::run(). Child classes may override this method to register customized client scripts.

Registers necessary client scripts. This method is invoked by CBaseListView::run(). Child classes may override this method to register customized client scripts.

abstract public
# renderItems( )

Renders the data items for the view. Each item is corresponding to a single data model instance. Child classes should override this method to provide the actual item rendering logic.

Renders the data items for the view. Each item is corresponding to a single data model instance. Child classes should override this method to provide the actual item rendering logic.

Methods inherited from CWidget
__construct(), actions(), getController(), getId(), getOwner(), getViewFile(), getViewPath(), render(), setId()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderFile(), renderInternal(), widget()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public IDataProvider $dataProvider
#

the data provider for the view.

the data provider for the view.

public string $tagName 'div'
#

the tag name for the view container. Defaults to 'div'.

the tag name for the view container. Defaults to 'div'.

public array $htmlOptions array()
#

the HTML options for the view container tag.

the HTML options for the view container tag.

public boolean $enableSorting true
#

whether to enable sorting. Note that if the IDataProvider::sort property of CBaseListView::$dataProvider is false, this will be treated as false as well. When sorting is enabled, sortable columns will have their headers clickable to trigger sorting along that column. Defaults to true.

whether to enable sorting. Note that if the IDataProvider::sort property of CBaseListView::$dataProvider is false, this will be treated as false as well. When sorting is enabled, sortable columns will have their headers clickable to trigger sorting along that column. Defaults to true.

See

sortableAttributes
public boolean $enablePagination true
#

whether to enable pagination. Note that if the IDataProvider::pagination property of CBaseListView::$dataProvider is false, this will be treated as false as well. When pagination is enabled, a pager will be displayed in the view so that it can trigger pagination of the data display. Defaults to true.

whether to enable pagination. Note that if the IDataProvider::pagination property of CBaseListView::$dataProvider is false, this will be treated as false as well. When pagination is enabled, a pager will be displayed in the view so that it can trigger pagination of the data display. Defaults to true.

public array|string $pager array('class'=>'CLinkPager')
#

the configuration for the pager. Defaults to <span class="php-keyword1">array</span>(<span class="php-quote">'class'</span>=><span class="php-quote">'CLinkPager'</span>). String value will be treated as the class name of the pager (<span class="php-quote">'ClassName'</span> value is similar to the <span class="php-keyword1">array</span>(<span class="php-quote">'class'</span>=><span class="php-quote">'ClassName'</span>) value). See CBasePager and CLinkPager for more details about pager configuration array values.

the configuration for the pager. Defaults to <span class="php-keyword1">array</span>(<span class="php-quote">'class'</span>=><span class="php-quote">'CLinkPager'</span>). String value will be treated as the class name of the pager (<span class="php-quote">'ClassName'</span> value is similar to the <span class="php-keyword1">array</span>(<span class="php-quote">'class'</span>=><span class="php-quote">'ClassName'</span>) value). See CBasePager and CLinkPager for more details about pager configuration array values.

See

CBaseListView::$enablePagination
public string $template "{summary}\n{items}\n{pager}"
#

the template to be used to control the layout of various sections in the view. These tokens are recognized: {summary}, {items} and {pager}. They will be replaced with the 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: {summary}, {items} and {pager}. They will be replaced with the summary text, the items, and the pager.

public string $summaryText
#
the summary text template for the view. These tokens are recognized and will be replaced with the corresponding values:
  • {start}: the starting row number (1-based) currently being displayed
  • {end}: the ending row number (1-based) currently being displayed
  • {count}: the total number of rows
  • {page}: the page number (1-based) current being displayed, available since version 1.1.3
  • {pages}: the total number of pages, available since version 1.1.3
the summary text template for the view. These tokens are recognized and will be replaced with the corresponding values:
  • {start}: the starting row number (1-based) currently being displayed
  • {end}: the ending row number (1-based) currently being displayed
  • {count}: the total number of rows
  • {page}: the page number (1-based) current being displayed, available since version 1.1.3
  • {pages}: the total number of pages, available since version 1.1.3
public string $summaryTagName 'div'
#

the HTML tag name for the container of the CBaseListView::$summaryText property.

the HTML tag name for the container of the CBaseListView::$summaryText property.

Since

1.1.16
public string $emptyText
#

the message to be displayed when CBaseListView::$dataProvider does not have any data.

the message to be displayed when CBaseListView::$dataProvider does not have any data.

public string $emptyTagName 'span'
#

the HTML tag name for the container of the CBaseListView::$emptyText property.

the HTML tag name for the container of the CBaseListView::$emptyText property.

public string $emptyCssClass 'empty'
#

the CSS class name for the container of the CBaseListView::$emptyText property. Defaults to 'empty'.

the CSS class name for the container of the CBaseListView::$emptyText property. Defaults to 'empty'.

Since

1.1.16
public string $itemsCssClass 'items'
#

the CSS class name for the container of all data item display. Defaults to 'items'. Note, this property must not contain false, null or empty string values. Otherwise such values may cause undefined behavior.

the CSS class name for the container of all data item display. Defaults to 'items'. Note, this property must not contain false, null or empty string values. Otherwise such values may cause undefined behavior.

public string $summaryCssClass 'summary'
#

the CSS class name for the summary text container. Defaults to 'summary'.

the CSS class name for the summary text container. Defaults to 'summary'.

public string $pagerCssClass 'pager'
#

the CSS class name for the pager container. Defaults to 'pager'. Note, this property must not contain false, null or empty string values. Otherwise such values may cause undefined behavior.

the CSS class name for the pager container. Defaults to 'pager'. Note, this property must not contain false, null or empty string values. Otherwise such values may cause undefined behavior.

public string $loadingCssClass 'loading'
#

the CSS class name that will be assigned to the widget container element when the widget is updating its content via AJAX. Defaults to 'loading'.

the CSS class name that will be assigned to the widget container element when the widget is updating its content via AJAX. Defaults to 'loading'.

Since

1.1.1
Properties inherited from CWidget
$actionPrefix, $skin
Magic properties inherited from CWidget
$controller, $id, $owner, $viewPath
API documentation generated by ApiGen 2.8.0