PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TDataList

TDataList class

TDataList represents a data bound and updatable list control.

Like TRepeater, TDataList displays its content repeatedly based on the data fetched from setDataSource DataSource. The repeated contents in TDataList are called items, which are controls and can be accessed through getItems Items. When TDataBoundControl::dataBind() is invoked, TDataList creates an item for each row of data and binds the data row to the item. Optionally, a TDataList can have a header, a footer and/or separators between items.

TDataList differs from TRepeater in that it supports tiling the items in different manners and it maintains status of items to handle data update.

The layout of the repeated contents are specified by inline templates. TDataList items, header, footer, etc. are being instantiated with the corresponding templates when data is being bound to the repeater.

Since v3.1.0, the layout can also be by renderers. A renderer is a control class that can be instantiated as datalist items, header, etc. A renderer can thus be viewed as an external template (in fact, it can also be non-templated controls).

A renderer can be any control class.

  • If the class implements IDataRenderer, the Data

property will be set as the data row during databinding. Many PRADO controls implement this interface, such as TLabel, TTextBox, etc.

  • If the class implements IItemDataRenderer, the ItemIndex property will be set

as the zero-based index of the item in the datalist item collection, and the ItemType property as the item's type (such as TListItemType::Item). TDataListItemRenderer may be used as the convenient base class which already implements IDataItemRenderer.

The following properties are used to specify different types of template and renderer for a datalist:

  • setItemTemplate ItemTemplate, setItemRenderer ItemRenderer:

for each repeated row of data

  • setAlternatingItemTemplate AlternatingItemTemplate, setAlternatingItemRenderer AlternatingItemRenderer:

for each alternating row of data. If not set, setItemTemplate ItemTemplate or setItemRenderer ItemRenderer will be used instead.

  • setHeaderTemplate HeaderTemplate, setHeaderRenderer HeaderRenderer:

for the datalist header.

  • setFooterTemplate FooterTemplate, setFooterRenderer FooterRenderer:

for the datalist footer.

  • setSeparatorTemplate SeparatorTemplate, setSeparatorRenderer SeparatorRenderer:

for content to be displayed between items.

  • setEmptyTemplate EmptyTemplate, setEmptyRenderer EmptyRenderer:

used when data bound to the datalist is empty.

  • setEditItemTemplate EditItemTemplate, setEditItemRenderer EditItemRenderer:

for the row being editted.

  • setSelectedItemTemplate SelectedItemTemplate, setSelectedItemRenderer SelectedItemRenderer:

for the row being selected.

If a content type is defined with both a template and a renderer, the latter takes precedence.

When TDataBoundControl::dataBind() is being called, TDataList undergoes the following lifecycles for each row of data:

  • create item based on templates or renderers
  • set the row of data to the item
  • raise onItemCreated OnItemCreated:
  • add the item as a child control
  • call dataBind() of the item
  • raise onItemDataBound OnItemDataBound:

TDataList raises an onItemCommand OnItemCommand whenever a button control within some datalist item raises a OnCommand event. Therefore, you can handle all sorts of OnCommand event in a central place by writing an event handler for onItemCommand OnItemCommand.

An additional event is raised if the OnCommand event has one of the following command names:

  • edit: user wants to edit an item. OnEditCommand event will be raised.
  • update: user wants to save the change to an item. OnUpdateCommand event will be raised.
  • select: user selects an item. OnSelectedIndexChanged event will be raised.
  • delete: user deletes an item. OnDeleteCommand event will be raised.
  • cancel: user cancels previously editting action. OnCancelCommand event will be raised.

TDataList provides a few properties to support tiling the items. The number of columns used to display the data items is specified via setRepeatColumns RepeatColumns property, while the setRepeatDirection RepeatDirection governs the order of the items being rendered. The layout of the data items in the list is specified via setRepeatLayout RepeatLayout, which can take one of the following values:

  • Table (default): items are organized using HTML table and cells.

When using this layout, one can set setCellPadding CellPadding and setCellSpacing CellSpacing to adjust the cellpadding and cellpadding of the table, and setCaption Caption and setCaptionAlign CaptionAlign to add a table caption with the specified alignment.

  • Flow: items are organized using HTML spans and breaks.
  • Raw: TDataList does not generate any HTML tags to do the tiling.

Items in TDataList can be in one of the three status: normal browsing, being editted and being selected. To change the status of a particular item, set setSelectedItemIndex SelectedItemIndex or setEditItemIndex EditItemIndex. The former will change the indicated item to selected mode, which will cause the item to use setSelectedItemTemplate SelectedItemTemplate or setSelectedItemRenderer SelectedItemRenderer for presentation. The latter will change the indicated item to edit mode and to use corresponding template or renderer. Note, if an item is in edit mode, then selecting this item will have no effect.

Different styles may be applied to items in different status. The style application is performed in a hierarchical way: Style in higher hierarchy will inherit from styles in lower hierarchy. Starting from the lowest hierarchy, the item styles include

  • item's own style
  • getItemStyle ItemStyle
  • getAlternatingItemStyle AlternatingItemStyle
  • getSelectedItemStyle SelectedItemStyle
  • getEditItemStyle EditItemStyle.

Therefore, if background color is set as red in getItemStyle ItemStyle, getEditItemStyle EditItemStyle will also have red background color unless it is set to a different value explicitly.

When a page containing a datalist is post back, the datalist will restore automatically all its contents, including items, header, footer and separators. However, the data row associated with each item will not be recovered and become null. To access the data, use one of the following ways:

  • Use getDataKeys DataKeys to obtain the data key associated with

the specified datalist item and use the key to fetch the corresponding data from some persistent storage such as DB.

  • Save the whole dataset in viewstate, which will restore the dataset automatically upon postback.

Be aware though, if the size of your dataset is big, your page size will become big. Some complex data may also have serializing problem if saved in viewstate.

TComponent
Extended by TApplicationComponent
Extended by TControl implements IRenderable, IBindable
Extended by TWebControl implements IStyleable
Extended by TDataBoundControl
Extended by TBaseDataList
Extended by TDataList implements INamingContainer, IRepeatInfoUser

Direct known subclasses

TActiveDataList
Package: System\Web\UI\WebControls
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Web/UI/WebControls/TDataList.php
Methods summary
public TDataListItemCollection
# getItems( )

Returns

TDataListItemCollection
item list
public integer
# getItemCount( )

Returns

integer
number of items

Implementation of

IRepeatInfoUser::getItemCount()
public string
# getItemRenderer( )

Returns

string
the class name for datalist items. Defaults to empty, meaning not set.

Since

3.1.0
public
# setItemRenderer( string $value )

Sets the item renderer class.

Sets the item renderer class.

If not empty, the class will be used to instantiate as datalist items. This property takes precedence over getItemTemplate ItemTemplate.

Parameters

$value
string
the renderer class name in namespace format.

Since

3.1.0

See

TDataList::setItemTemplate()
public string
# getAlternatingItemRenderer( )

Returns

string
the class name for alternative datalist items. Defaults to empty, meaning not set.

Since

3.1.0
public
# setAlternatingItemRenderer( string $value )

Sets the alternative item renderer class.

Sets the alternative item renderer class.

If not empty, the class will be used to instantiate as alternative datalist items. This property takes precedence over getAlternatingItemTemplate AlternatingItemTemplate.

Parameters

$value
string
the renderer class name in namespace format.

Since

3.1.0

See

TDataList::setAlternatingItemTemplate()
public string
# getEditItemRenderer( )

Returns

string
the class name for the datalist item being editted. Defaults to empty, meaning not set.

Since

3.1.0
public
# setEditItemRenderer( string $value )

Sets the renderer class for the datalist item being editted.

Sets the renderer class for the datalist item being editted.

If not empty, the class will be used to instantiate as the datalist item. This property takes precedence over getEditItemTemplate EditItemTemplate.

Parameters

$value
string
the renderer class name in namespace format.

Since

3.1.0

See

TDataList::setEditItemTemplate()
public string
# getSelectedItemRenderer( )

Returns

string
the class name for the datalist item being selected. Defaults to empty, meaning not set.

Since

3.1.0
public
# setSelectedItemRenderer( string $value )

Sets the renderer class for the datalist item being selected.

Sets the renderer class for the datalist item being selected.

If not empty, the class will be used to instantiate as the datalist item. This property takes precedence over getSelectedItemTemplate SelectedItemTemplate.

Parameters

$value
string
the renderer class name in namespace format.

Since

3.1.0

See

TDataList::setSelectedItemTemplate()
public string
# getSeparatorRenderer( )

Returns

string
the class name for datalist item separators. Defaults to empty, meaning not set.

Since

3.1.0
public
# setSeparatorRenderer( string $value )

Sets the datalist item separator renderer class.

Sets the datalist item separator renderer class.

If not empty, the class will be used to instantiate as datalist item separators. This property takes precedence over getSeparatorTemplate SeparatorTemplate.

Parameters

$value
string
the renderer class name in namespace format.

Since

3.1.0

See

TDataList::setSeparatorTemplate()
public string
# getHeaderRenderer( )

Returns

string
the class name for datalist header item. Defaults to empty, meaning not set.

Since

3.1.0
public
# setHeaderRenderer( string $value )

Sets the datalist header renderer class.

Sets the datalist header renderer class.

If not empty, the class will be used to instantiate as datalist header item. This property takes precedence over getHeaderTemplate HeaderTemplate.

Parameters

$value
string
the renderer class name in namespace format.

Since

3.1.0

See

TDataList::setHeaderTemplate()
public string
# getFooterRenderer( )

Returns

string
the class name for datalist footer item. Defaults to empty, meaning not set.

Since

3.1.0
public
# setFooterRenderer( string $value )

Sets the datalist footer renderer class.

Sets the datalist footer renderer class.

If not empty, the class will be used to instantiate as datalist footer item. This property takes precedence over getFooterTemplate FooterTemplate.

Parameters

$value
string
the renderer class name in namespace format.

Since

3.1.0

See

TDataList::setFooterTemplate()
public string
# getEmptyRenderer( )

Returns

string
the class name for empty datalist item. Defaults to empty, meaning not set.

Since

3.1.0
public
# setEmptyRenderer( string $value )

Sets the datalist empty renderer class.

Sets the datalist empty renderer class.

The empty renderer is created as the child of the datalist if data bound to the datalist is empty. This property takes precedence over getEmptyTemplate EmptyTemplate.

Parameters

$value
string
the renderer class name in namespace format.

Since

3.1.0

See

TDataList::setEmptyTemplate()
public ITemplate
# getItemTemplate( )

Returns

ITemplate
the template for item
public
# setItemTemplate( ITemplate $value )

Parameters

$value
ITemplate
the template for item

Throws

TInvalidDataTypeException
if the input is not an ITemplate or not null.
public TTableItemStyle
# getItemStyle( )

Returns

TTableItemStyle
the style for item
public ITemplate
# getAlternatingItemTemplate( )

Returns

ITemplate
the template for each alternating item
public
# setAlternatingItemTemplate( ITemplate $value )

Parameters

$value
ITemplate
the template for each alternating item

Throws

TInvalidDataTypeException
if the input is not an ITemplate or not null.
public TTableItemStyle
# getAlternatingItemStyle( )

Returns

TTableItemStyle
the style for each alternating item
public ITemplate
# getSelectedItemTemplate( )

Returns

ITemplate
the selected item template
public
# setSelectedItemTemplate( ITemplate $value )

Parameters

$value
ITemplate
the selected item template

Throws

TInvalidDataTypeException
if the input is not an ITemplate or not null.
public TTableItemStyle
# getSelectedItemStyle( )

Returns

TTableItemStyle
the style for selected item
public ITemplate
# getEditItemTemplate( )

Returns

ITemplate
the edit item template
public
# setEditItemTemplate( ITemplate $value )

Parameters

$value
ITemplate
the edit item template

Throws

TInvalidDataTypeException
if the input is not an ITemplate or not null.
public TTableItemStyle
# getEditItemStyle( )

Returns

TTableItemStyle
the style for edit item
public ITemplate
# getHeaderTemplate( )

Returns

ITemplate
the header template
public
# setHeaderTemplate( ITemplate $value )

Parameters

$value
ITemplate
the header template

Throws

TInvalidDataTypeException
if the input is not an ITemplate or not null.
public TTableItemStyle
# getHeaderStyle( )

Returns

TTableItemStyle
the style for header
public TControl
# getHeader( )

Returns

TControl
the header item
public ITemplate
# getFooterTemplate( )

Returns

ITemplate
the footer template
public
# setFooterTemplate( ITemplate $value )

Parameters

$value
ITemplate
the footer template

Throws

TInvalidDataTypeException
if the input is not an ITemplate or not null.
public TTableItemStyle
# getFooterStyle( )

Returns

TTableItemStyle
the style for footer
public TControl
# getFooter( )

Returns

TControl
the footer item
public ITemplate
# getEmptyTemplate( )

Returns

ITemplate
the template applied when no data is bound to the datalist
public
# setEmptyTemplate( ITemplate $value )

Parameters

$value
ITemplate
the template applied when no data is bound to the datalist

Throws

TInvalidDataTypeException
if the input is not an ITemplate or not null.
public ITemplate
# getSeparatorTemplate( )

Returns

ITemplate
the separator template
public
# setSeparatorTemplate( ITemplate $value )

Parameters

$value
ITemplate
the separator template

Throws

TInvalidDataTypeException
if the input is not an ITemplate or not null.
public TTableItemStyle
# getSeparatorStyle( )

Returns

TTableItemStyle
the style for separator
public integer
# getSelectedItemIndex( )

Returns

integer
the zero-based index of the selected item in getItems Items. A value -1 means no item selected.
public
# setSelectedItemIndex( integer $value )

Selects an item by its index in getItems Items. Previously selected item will be un-selected. If the item to be selected is already in edit mode, it will remain in edit mode. If the index is less than 0, any existing selection will be cleared up.

Selects an item by its index in getItems Items. Previously selected item will be un-selected. If the item to be selected is already in edit mode, it will remain in edit mode. If the index is less than 0, any existing selection will be cleared up.

Parameters

$value
integer
the selected item index
public TControl
# getSelectedItem( )

Returns

TControl
the selected item, null if no item is selected.
public mixed
# getSelectedDataKey( )

Returns

mixed
the key value of the currently selected item

Throws

TInvalidOperationException
if getDataKeyField DataKeyField is empty.
public integer
# getEditItemIndex( )

Returns

integer
the zero-based index of the edit item in getItems Items. A value -1 means no item is in edit mode.
public
# setEditItemIndex( integer $value )

Edits an item by its index in getItems Items. Previously editting item will change to normal item state. If the index is less than 0, any existing edit item will be cleared up.

Edits an item by its index in getItems Items. Previously editting item will change to normal item state. If the index is less than 0, any existing edit item will be cleared up.

Parameters

$value
integer
the edit item index
public TControl
# getEditItem( )

Returns

TControl
the edit item
public boolean
# getShowHeader( )

Returns

boolean
whether the header should be shown. Defaults to true.
public
# setShowHeader( boolean $value )

Parameters

$value
boolean
whether to show header
public boolean
# getShowFooter( )

Returns

boolean
whether the footer should be shown. Defaults to true.
public
# setShowFooter( boolean $value )

Parameters

$value
boolean
whether to show footer
protected TRepeatInfo
# getRepeatInfo( )

Returns

TRepeatInfo
repeat information (primarily used by control developers)
public string
# getCaption( )

Returns

string
caption of the table layout
public
# setCaption( string $value )

Parameters

$value
string
caption of the table layout
public TTableCaptionAlign
# getCaptionAlign( )

Returns

TTableCaptionAlign
alignment of the caption of the table layout. Defaults to TTableCaptionAlign::NotSet.
public TTableCaptionAlign
# setCaptionAlign( mixed $value )

Returns

TTableCaptionAlign
alignment of the caption of the table layout.
public integer
# getRepeatColumns( )

Returns

integer
the number of columns that the list should be displayed with. Defaults to 0 meaning not set.
public
# setRepeatColumns( integer $value )

Parameters

$value
integer
the number of columns that the list should be displayed with.
public TRepeatDirection
# getRepeatDirection( )

Returns

TRepeatDirection
the direction of traversing the list, defaults to TRepeatDirection::Vertical
public
# setRepeatDirection( TRepeatDirection $value )

Parameters

$value
TRepeatDirection
the direction of traversing the list
public TRepeatLayout
# getRepeatLayout( )

Returns

TRepeatLayout
how the list should be displayed, using table or using line breaks. Defaults to TRepeatLayout::Table.
public
# setRepeatLayout( TRepeatLayout $value )

Parameters

$value
TRepeatLayout
how the list should be displayed, using table or using line breaks
public boolean
# bubbleEvent( TControl $sender, TEventParameter $param )

This method overrides parent's implementation to handle onItemCommand OnItemCommand event which is bubbled from datalist items and their child controls. If the event parameter is TDataListCommandEventParameter and the command name is a recognized one, which includes 'select', 'edit', 'delete', 'update', and 'cancel' (case-insensitive), then a corresponding command event is also raised (such as onEditCommand OnEditCommand). This method should only be used by control developers.

This method overrides parent's implementation to handle onItemCommand OnItemCommand event which is bubbled from datalist items and their child controls. If the event parameter is TDataListCommandEventParameter and the command name is a recognized one, which includes 'select', 'edit', 'delete', 'update', and 'cancel' (case-insensitive), then a corresponding command event is also raised (such as onEditCommand OnEditCommand). This method should only be used by control developers.

Parameters

$sender
TControl
the sender of the event
$param
TEventParameter
event parameter

Returns

boolean
whether the event bubbling should stop here.

Overrides

TControl::bubbleEvent()
public
# onItemCreated( TDataListItemEventParameter $param )

Raises OnItemCreated event. This method is invoked after a data list item is created and instantiated with template, but before added to the page hierarchy. The datalist item control responsible for the event can be determined from the event parameter. If you override this method, be sure to call parent's implementation so that event handlers have chance to respond to the event.

Raises OnItemCreated event. This method is invoked after a data list item is created and instantiated with template, but before added to the page hierarchy. The datalist item control responsible for the event can be determined from the event parameter. If you override this method, be sure to call parent's implementation so that event handlers have chance to respond to the event.

Parameters

$param
TDataListItemEventParameter
event parameter
public
# onItemDataBound( TDataListItemEventParameter $param )

Raises OnItemDataBound event. This method is invoked right after an item is data bound. The datalist item control responsible for the event can be determined from the event parameter. If you override this method, be sure to call parent's implementation so that event handlers have chance to respond to the event.

Raises OnItemDataBound event. This method is invoked right after an item is data bound. The datalist item control responsible for the event can be determined from the event parameter. If you override this method, be sure to call parent's implementation so that event handlers have chance to respond to the event.

Parameters

$param
TDataListItemEventParameter
event parameter
public
# onItemCommand( TDataListCommandEventParameter $param )

Raises OnItemCommand event. This method is invoked when a child control of the data list raises an OnCommand event.

Raises OnItemCommand event. This method is invoked when a child control of the data list raises an OnCommand event.

Parameters

$param
TDataListCommandEventParameter
event parameter
public
# onEditCommand( TDataListCommandEventParameter $param )

Raises OnEditCommand event. This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'edit' (case-insensitive).

Raises OnEditCommand event. This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'edit' (case-insensitive).

Parameters

$param
TDataListCommandEventParameter
event parameter
public
# onDeleteCommand( TDataListCommandEventParameter $param )

Raises OnDeleteCommand event. This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'delete' (case-insensitive).

Raises OnDeleteCommand event. This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'delete' (case-insensitive).

Parameters

$param
TDataListCommandEventParameter
event parameter
public
# onUpdateCommand( TDataListCommandEventParameter $param )

Raises OnUpdateCommand event. This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'update' (case-insensitive).

Raises OnUpdateCommand event. This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'update' (case-insensitive).

Parameters

$param
TDataListCommandEventParameter
event parameter
public
# onCancelCommand( TDataListCommandEventParameter $param )

Raises OnCancelCommand event. This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'cancel' (case-insensitive).

Raises OnCancelCommand event. This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'cancel' (case-insensitive).

Parameters

$param
TDataListCommandEventParameter
event parameter
public boolean
# getHasHeader( )

Returns a value indicating whether this control contains header item. This method is required by IRepeatInfoUser interface.

Returns a value indicating whether this control contains header item. This method is required by IRepeatInfoUser interface.

Returns

boolean
whether the datalist has header

Implementation of

IRepeatInfoUser::getHasHeader()
public boolean
# getHasFooter( )

Returns a value indicating whether this control contains footer item. This method is required by IRepeatInfoUser interface.

Returns a value indicating whether this control contains footer item. This method is required by IRepeatInfoUser interface.

Returns

boolean
whether the datalist has footer

Implementation of

IRepeatInfoUser::getHasFooter()
public boolean
# getHasSeparators( )

Returns a value indicating whether this control contains separator items. This method is required by IRepeatInfoUser interface.

Returns a value indicating whether this control contains separator items. This method is required by IRepeatInfoUser interface.

Returns

boolean
always false.

Implementation of

IRepeatInfoUser::getHasSeparators()
public TStyle
# generateItemStyle( string $itemType, integer $index )

Returns a style used for rendering items. This method is required by IRepeatInfoUser interface.

Returns a style used for rendering items. This method is required by IRepeatInfoUser interface.

Parameters

$itemType
string
item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager)
$index
integer
index of the item being rendered

Returns

TStyle
item style

Implementation of

IRepeatInfoUser::generateItemStyle()
public
# renderItem( THtmlWriter $writer, TRepeatInfo $repeatInfo, string $itemType, integer $index )

Renders an item in the list. This method is required by IRepeatInfoUser interface.

Renders an item in the list. This method is required by IRepeatInfoUser interface.

Parameters

$writer
THtmlWriter
writer for rendering purpose
$repeatInfo
TRepeatInfo
repeat information
$itemType
string
item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager)
$index
integer
zero-based index of the item in the item list

Implementation of

IRepeatInfoUser::renderItem()
protected TControl
# createItem( integer $itemIndex, TListItemType $itemType )

Creates a datalist item instance based on the item type and index.

Creates a datalist item instance based on the item type and index.

Parameters

$itemIndex
integer
zero-based item index
$itemType
TListItemType
item type

Returns

TControl
created datalist item
protected
# createEmptyContent( )

Creates empty datalist content.

Creates empty datalist content.

protected
# applyItemStyles( )

Applies styles to items, header, footer and separators. Item styles are applied in a hierarchical way. Style in higher hierarchy will inherit from styles in lower hierarchy. Starting from the lowest hierarchy, the item styles include item's own style, getItemStyle ItemStyle, getAlternatingItemStyle AlternatingItemStyle, getSelectedItemStyle SelectedItemStyle, and getEditItemStyle EditItemStyle. Therefore, if background color is set as red in getItemStyle ItemStyle, getEditItemStyle EditItemStyle will also have red background color unless it is set to a different value explicitly.

Applies styles to items, header, footer and separators. Item styles are applied in a hierarchical way. Style in higher hierarchy will inherit from styles in lower hierarchy. Starting from the lowest hierarchy, the item styles include item's own style, getItemStyle ItemStyle, getAlternatingItemStyle AlternatingItemStyle, getSelectedItemStyle SelectedItemStyle, and getEditItemStyle EditItemStyle. Therefore, if background color is set as red in getItemStyle ItemStyle, getEditItemStyle EditItemStyle will also have red background color unless it is set to a different value explicitly.

public
# saveState( )

Saves item count in viewstate. This method is invoked right before control state is to be saved.

Saves item count in viewstate. This method is invoked right before control state is to be saved.

Overrides

TControl::saveState()
public
# loadState( )

Loads item count information from viewstate. This method is invoked right after control state is loaded.

Loads item count information from viewstate. This method is invoked right after control state is loaded.

Overrides

TControl::loadState()
public
# reset( )

Clears up all items in the data list.

Clears up all items in the data list.

protected
# restoreItemsFromViewState( )

Creates data list items based on viewstate information.

Creates data list items based on viewstate information.

protected
# performDataBinding( Traversable $data )

Performs databinding to populate data list items from data source. This method is invoked by dataBind(). You may override this function to provide your own way of data population.

Performs databinding to populate data list items from data source. This method is invoked by dataBind(). You may override this function to provide your own way of data population.

Parameters

$data
Traversable
the data
public
# render( THtmlWriter $writer )

Renders the data list control. This method overrides the parent implementation.

Renders the data list control. This method overrides the parent implementation.

Parameters

$writer
THtmlWriter
writer for rendering purpose.

Overrides

TWebControl::render()
Methods inherited from TBaseDataList
createStyle(), getCellPadding(), getCellSpacing(), getDataFieldValue(), getDataKeyField(), getDataKeys(), getGridLines(), getHorizontalAlign(), onSelectedIndexChanged(), setCellPadding(), setCellSpacing(), setDataKeyField(), setGridLines(), setHorizontalAlign()
Methods inherited from TDataBoundControl
createPagedDataSource(), dataBind(), dataSourceViewChanged(), determineDataSource(), ensureDataBound(), getAllowCustomPaging(), getAllowPaging(), getCurrentPageIndex(), getDataMember(), getDataSource(), getDataSourceID(), getDataSourceView(), getInitialized(), getIsDataBound(), getPageCount(), getPageSize(), getRequiresDataBinding(), getSelectParameters(), getUsingDataSourceID(), getVirtualItemCount(), onDataBound(), onDataSourceChanged(), onInit(), onPreRender(), pagePreLoad(), setAllowCustomPaging(), setAllowPaging(), setCurrentPageIndex(), setDataMember(), setDataSource(), setDataSourceID(), setInitialized(), setIsDataBound(), setPageSize(), setRequiresDataBinding(), setVirtualItemCount(), validateDataSource()
Methods inherited from TWebControl
addAttributesToRender(), clearStyle(), copyBaseAttributes(), getAccessKey(), getBackColor(), getBorderColor(), getBorderStyle(), getBorderWidth(), getCssClass(), getDecorator(), getDisplay(), getEnsureId(), getFont(), getForeColor(), getHasStyle(), getHeight(), getStyle(), getTabIndex(), getTagName(), getToolTip(), getWidth(), renderBeginTag(), renderContents(), renderEndTag(), setAccessKey(), setBackColor(), setBorderColor(), setBorderStyle(), setBorderWidth(), setCssClass(), setDisplay(), setEnsureId(), setForeColor(), setHeight(), setStyle(), setTabIndex(), setToolTip(), setWidth()
Methods inherited from TControl
__construct(), __get(), addParsedObject(), addToPostDataLoader(), addedControl(), applyStyleSheetSkin(), autoBindProperty(), autoDataBindProperties(), bindProperty(), broadcastEvent(), clearChildState(), clearControlState(), clearNamingContainer(), clearViewState(), convertUniqueIdToClientId(), createChildControls(), createControlCollection(), dataBindChildren(), dataBindProperties(), ensureChildControls(), findControl(), findControlsByID(), findControlsByType(), focus(), getAdapter(), getAllowChildControls(), getAttribute(), getAttributes(), getChildControlsCreated(), getClientID(), getControlStage(), getControlState(), getControls(), getCustomData(), getEnableTheming(), getEnableViewState(), getEnabled(), getHasAdapter(), getHasAttributes(), getHasChildInitialized(), getHasControls(), getHasInitialized(), getHasLoaded(), getHasLoadedPostData(), getHasPreRendered(), getID(), getIsSkinApplied(), getNamingContainer(), getPage(), getParent(), getRegisteredObject(), getSkinID(), getSourceTemplateControl(), getTemplateControl(), getUniqueID(), getViewState(), getVisible(), hasAttribute(), initRecursive(), isDescendentOf(), isObjectRegistered(), loadRecursive(), loadStateRecursive(), onDataBinding(), onLoad(), onUnload(), preRenderRecursive(), raiseBubbleEvent(), registerObject(), removeAttribute(), removedControl(), renderChildren(), renderControl(), saveStateRecursive(), setAdapter(), setAttribute(), setChildControlsCreated(), setControlStage(), setControlState(), setCustomData(), setEnableTheming(), setEnableViewState(), setEnabled(), setID(), setPage(), setSkinID(), setTemplateControl(), setViewState(), setVisible(), trackViewState(), traverseChildControls(), unbindProperty(), unloadRecursive(), unregisterObject()
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __isset(), __set(), __sleep(), __unset(), __wakeup(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants summary
string CMD_SELECT 'Select'
#

Command name that TDataList understands. They are case-insensitive.

Command name that TDataList understands. They are case-insensitive.

string CMD_EDIT 'Edit'
#
string CMD_UPDATE 'Update'
#
string CMD_DELETE 'Delete'
#
string CMD_CANCEL 'Cancel'
#
Constants inherited from TControl
AUTOMATIC_ID_PREFIX, CLIENT_ID_SEPARATOR, CS_CHILD_INITIALIZED, CS_CONSTRUCTED, CS_INITIALIZED, CS_LOADED, CS_PRERENDERED, CS_STATE_LOADED, ID_FORMAT, ID_SEPARATOR, IS_CHILD_CREATED, IS_CREATING_CHILD, IS_DISABLE_THEMING, IS_DISABLE_VIEWSTATE, IS_ID_SET, IS_SKIN_APPLIED, IS_STYLESHEET_APPLIED, RF_ADAPTER, RF_AUTO_BINDINGS, RF_CHILD_STATE, RF_CONTROLS, RF_CONTROLSTATE, RF_DATA_BINDINGS, RF_EVENTS, RF_NAMED_CONTROLS, RF_NAMED_CONTROLS_ID, RF_NAMED_OBJECTS, RF_SKIN_ID
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Properties inherited from TWebControl
$_decorator
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO