Index

Classes

  • TAPCCache
  • TApplicationStateCacheDependency
  • TCache
  • TCacheDependency
  • TCacheDependencyList
  • TChainedCacheDependency
  • TDbCache
  • TDirectoryCacheDependency
  • TEtcdCache
  • TFileCacheDependency
  • TGlobalStateCacheDependency
  • TMemCache
  • TRedisCache
  • TArraySubscription
  • TAttributeCollection
  • TCollectionSubscription
  • TDummyDataSource
  • TDummyDataSourceIterator
  • TList
  • TListItemCollection
  • TMap
  • TPagedDataSource
  • TPagedList
  • TPagedListFetchDataEventParameter
  • TPagedListIterator
  • TPagedListPageChangedEventParameter
  • TPagedMapIterator
  • TPriorityList
  • TPriorityMap
  • TQueue
  • TQueueIterator
  • TStack
  • TWeakCallableCollection
  • TWeakList
  • TActiveRecordConfigurationException
  • TActiveRecordException
  • TActiveRecordBelongsTo
  • TActiveRecordHasMany
  • TActiveRecordHasManyAssociation
  • TActiveRecordHasOne
  • TActiveRecordRelation
  • TActiveRecordRelationContext
  • TIbmScaffoldInput
  • TMssqlScaffoldInput
  • TMysqlScaffoldInput
  • TPgsqlScaffoldInput
  • TScaffoldInputBase
  • TScaffoldInputCommon
  • TSqliteScaffoldInput
  • TScaffoldBase
  • TScaffoldEditView
  • TScaffoldListView
  • TScaffoldSearch
  • TScaffoldView
  • TActiveRecord
  • TActiveRecordChangeEventParameter
  • TActiveRecordConfig
  • TActiveRecordCriteria
  • TActiveRecordGateway
  • TActiveRecordInvalidFinderResult
  • TActiveRecordManager
  • TMssqlCommandBuilder
  • TMssqlMetaData
  • TMssqlTableColumn
  • TMssqlTableInfo
  • TMysqlCommandBuilder
  • TMysqlMetaData
  • TMysqlTableColumn
  • TMysqlTableInfo
  • TOracleCommandBuilder
  • TOracleMetaData
  • TOracleTableColumn
  • TOracleTableInfo
  • TPgsqlCommandBuilder
  • TPgsqlMetaData
  • TPgsqlTableColumn
  • TPgsqlTableInfo
  • TSqliteCommandBuilder
  • TSqliteMetaData
  • TSqliteTableColumn
  • TSqliteTableInfo
  • TDbCommandBuilder
  • TDbMetaData
  • TDbTableColumn
  • TDbTableInfo
  • TDataGatewayCommand
  • TDataGatewayEventParameter
  • TDataGatewayResultEventParameter
  • TSqlCriteria
  • TTableGateway
  • TDiscriminator
  • TInlineParameterMapParser
  • TParameterMap
  • TParameterProperty
  • TResultMap
  • TResultProperty
  • TSimpleDynamicParser
  • TSqlMapCacheKey
  • TSqlMapCacheModel
  • TSqlMapCacheTypes
  • TSqlMapDelete
  • TSqlMapInsert
  • TSqlMapSelect
  • TSqlMapSelectKey
  • TSqlMapStatement
  • TSqlMapUpdate
  • TSqlMapXmlConfigBuilder
  • TSqlMapXmlConfiguration
  • TSqlMapXmlMappingConfiguration
  • TSubMap
  • TInvalidPropertyException
  • TLazyLoadList
  • TObjectProxy
  • TPropertyAccess
  • TSqlMapApplicationCache
  • TSqlMapCache
  • TSqlMapConfigurationException
  • TSqlMapDuplicateException
  • TSqlMapException
  • TSqlMapExecutionException
  • TSqlMapFifoCache
  • TSqlMapLruCache
  • TSqlMapPagedList
  • TSqlMapTypeHandler
  • TSqlMapTypeHandlerRegistry
  • TSqlMapUndefinedException
  • TCachingStatement
  • TDeleteMappedStatement
  • TInsertMappedStatement
  • TMappedStatement
  • TPostSelectBinding
  • TPreparedCommand
  • TPreparedStatement
  • TPreparedStatementFactory
  • TResultSetListItemParameter
  • TResultSetMapItemParameter
  • TSelectMappedStatement
  • TSimpleDynamicSql
  • TSqlMapObjectCollectionTree
  • TStaticSql
  • TUpdateMappedStatement
  • TSqlMapConfig
  • TSqlMapGateway
  • TSqlMapManager
  • TDataSourceConfig
  • TDbColumnCaseMode
  • TDbCommand
  • TDbConnection
  • TDbDataReader
  • TDbNullConversionMode
  • TDbTransaction
  • TApplicationException
  • TConfigurationException
  • TDbConnectionException
  • TDbException
  • TErrorHandler
  • TException
  • TExitException
  • THttpException
  • TInvalidDataTypeException
  • TInvalidDataValueException
  • TInvalidOperationException
  • TIOException
  • TLogException
  • TNetworkException
  • TNotSupportedException
  • TPhpErrorException
  • TPhpFatalErrorException
  • TSocketException
  • TSystemException
  • TTemplateException
  • TUnknownMethodException
  • TUserException
  • ChoiceFormat
  • CultureInfo
  • TGettext
  • TGettext_MO
  • TGettext_PO
  • MessageCache
  • MessageFormat
  • MessageSource
  • MessageSource_Database
  • MessageSource_gettext
  • MessageSource_PHP
  • MessageSource_XLIFF
  • TCache_Lite
  • TMessageSourceIOException
  • TChoiceFormat
  • TDateFormat
  • TGlobalization
  • TGlobalizationAutoDetect
  • TI18NControl
  • TNumberFormat
  • Translation
  • TTranslate
  • TTranslateParameter
  • TOutputWriter
  • TStdOutWriter
  • TStreamNotificationCallback
  • TStreamNotificationParameter
  • TTarFileExtractor
  • TTextWriter
  • DynamicMethodReflection
  • DynamicMethodsClassReflectionExtension
  • Prado
  • TPermissionEvent
  • TPermissionsAction
  • TPermissionsBehavior
  • TPermissionsConfigurationBehavior
  • TPermissionsManager
  • TUserOwnerRule
  • TUserPermissionsBehavior
  • TAuthManager
  • TAuthorizationRule
  • TAuthorizationRuleCollection
  • TDbUser
  • TDbUserManager
  • TSecurityManager
  • TUser
  • TUserManager
  • TUserManagerPasswordMode
  • TActiveRecordAction
  • TDbParameterAction
  • TFlushCachesAction
  • THelpAction
  • TPhpShellAction
  • TWebServerAction
  • TShellAction
  • TShellApplication
  • TShellLoginBehavior
  • TShellWriter
  • TApplication
  • TApplicationComponent
  • TApplicationConfiguration
  • TApplicationMode
  • TApplicationStatePersister
  • TComponent
  • TComponentReflection
  • TEnumerable
  • TEventHandler
  • TEventParameter
  • TEventResults
  • TEventSubscription
  • TModule
  • TPropertyValue
  • TService
  • TApplicationSignals
  • TBehaviorParameterLoader
  • TCaptureForkLog
  • TForkable
  • TGlobalClassAware
  • TMapLazyLoadBehavior
  • TMapRouteBehavior
  • TPageGlobalizationCharsetBehavior
  • TPageNoCacheBehavior
  • TPageTopAnchorBehavior
  • TParameterizeBehavior
  • TTimeZoneParameterBehavior
  • TCronMethodTask
  • TCronModule
  • TCronTask
  • TCronTaskInfo
  • TDbCronCleanLogTask
  • TDbCronModule
  • TShellCronAction
  • TShellCronLogBehavior
  • TShellDbCronAction
  • TTimeScheduler
  • TArrayHelper
  • TBitHelper
  • TEscCharsetConverter
  • TProcessHelper
  • TProcessWindowsPriority
  • TProcessWindowsPriorityName
  • TRational
  • TURational
  • TBaseBehavior
  • TBehavior
  • TBehaviorsModule
  • TBrowserLogRoute
  • TCallChain
  • TClassBehavior
  • TClassBehaviorEventParameter
  • TDataFieldAccessor
  • TDbLogRoute
  • TDbParameterModule
  • TDbPluginModule
  • TEmailLogRoute
  • TFileLogRoute
  • TFirebugLogRoute
  • TFirePhpLogRoute
  • TJsonRpcClient
  • TLogger
  • TLogRoute
  • TLogRouter
  • TParameterModule
  • TPluginModule
  • TRpcClient
  • TRpcClientRequestException
  • TRpcClientResponseException
  • TRpcClientTypesEnumerable
  • TSignalParameter
  • TSignalsDispatcher
  • TSimpleDateFormatter
  • TStdOutLogRoute
  • TSysLogRoute
  • TUtf8Converter
  • TVarDumper
  • TXmlRpcClient
  • TRequestConnectionUpgrade
  • TJavaScript
  • TJavaScriptAsset
  • TJavaScriptLiteral
  • TJavaScriptString
  • TFeedService
  • TJsonResponse
  • TJsonRpcProtocol
  • TJsonService
  • TPageConfiguration
  • TPageService
  • TRpcApiProvider
  • TRpcException
  • TRpcProtocol
  • TRpcServer
  • TRpcService
  • TSoapServer
  • TSoapService
  • TXmlRpcProtocol
  • TAssetManager
  • TCacheHttpSession
  • THttpCookie
  • THttpCookieCollection
  • THttpCookieSameSite
  • THttpRequest
  • THttpRequestParameter
  • THttpRequestResolveMethod
  • THttpRequestUrlFormat
  • THttpResponse
  • THttpResponseAdapter
  • THttpSession
  • THttpSessionCookieMode
  • THttpUtility
  • TSessionIterator
  • TUri
  • TUrlManager
  • TUrlMapping
  • TUrlMappingPattern
  • TUrlMappingPatternSecureConnection
  • TActiveBoundColumn
  • TActiveButton
  • TActiveButtonColumn
  • TActiveCheckBox
  • TActiveCheckBoxColumn
  • TActiveCheckBoxList
  • TActiveCheckBoxListItem
  • TActiveClientScript
  • TActiveControlAdapter
  • TActiveCustomValidator
  • TActiveCustomValidatorClientSide
  • TActiveDataGrid
  • TActiveDataGridPager
  • TActiveDataGridPagerEventParameter
  • TActiveDataList
  • TActiveDatePicker
  • TActiveDatePickerClientScript
  • TActiveDropDownList
  • TActiveDropDownListColumn
  • TActiveEditCommandColumn
  • TActiveFileUpload
  • TActiveFileUploadCallbackParams
  • TActiveFileUploadItem
  • TActiveHiddenField
  • TActiveHtmlArea
  • TActiveHtmlArea5
  • TActiveHyperLink
  • TActiveHyperLinkColumn
  • TActiveImage
  • TActiveImageButton
  • TActiveLabel
  • TActiveLinkButton
  • TActiveListBox
  • TActiveListControlAdapter
  • TActiveListItemCollection
  • TActiveLiteralColumn
  • TActiveMultiView
  • TActivePageAdapter
  • TActivePager
  • TActivePanel
  • TActiveRadioButton
  • TActiveRadioButtonItem
  • TActiveRadioButtonList
  • TActiveRatingList
  • TActiveRepeater
  • TActiveTableCell
  • TActiveTableCellEventParameter
  • TActiveTableRow
  • TActiveTableRowEventParameter
  • TActiveTemplateColumn
  • TActiveTextBox
  • TBaseActiveCallbackControl
  • TBaseActiveControl
  • TCallback
  • TCallbackClientScript
  • TCallbackClientSide
  • TCallbackErrorHandler
  • TCallbackEventParameter
  • TCallbackOptions
  • TCallbackPageStateTracker
  • TCallbackResponseAdapter
  • TCallbackResponseWriter
  • TEventTriggeredCallback
  • TInPlaceTextBox
  • TInvalidCallbackException
  • TMapCollectionDiff
  • TScalarDiff
  • TStyleDiff
  • TTimeTriggeredCallback
  • TTriggeredCallback
  • TValueTriggeredCallback
  • TViewStateDiff
  • TJuiAutoComplete
  • TJuiAutoCompleteEventParameter
  • TJuiAutoCompleteTemplate
  • TJuiCallbackPageStateTracker
  • TJuiControlAdapter
  • TJuiControlOptions
  • TJuiDatePicker
  • TJuiDialog
  • TJuiDialogButton
  • TJuiDraggable
  • TJuiDroppable
  • TJuiEventParameter
  • TJuiProgressbar
  • TJuiResizable
  • TJuiSelectable
  • TJuiSelectableTemplate
  • TJuiSlider
  • TJuiSortable
  • TJuiSortableTemplate
  • TBroadcastEventParameter
  • TCachePageStatePersister
  • TClientScriptManager
  • TClientSideOptions
  • TCommandEventParameter
  • TCompositeControl
  • TCompositeLiteral
  • TControl
  • TControlAdapter
  • TControlCollection
  • TEmptyControlCollection
  • TEventContent
  • TForm
  • THtmlWriter
  • TPage
  • TPageStateFormatter
  • TPageStatePersister
  • TSessionPageStatePersister
  • TSkinTemplate
  • TTemplate
  • TTemplateControl
  • TTemplateControlInheritable
  • TTemplateManager
  • TTheme
  • TThemeManager
  • TWebColors
  • TAccordion
  • TAccordionView
  • TAccordionViewCollection
  • TBaseDataList
  • TBaseValidator
  • TBoundColumn
  • TBulletedList
  • TBulletedListDisplayMode
  • TBulletedListEventParameter
  • TBulletStyle
  • TButton
  • TButtonColumn
  • TButtonColumnType
  • TButtonTag
  • TButtonType
  • TCaptcha
  • TCaptchaValidator
  • TCheckBox
  • TCheckBoxColumn
  • TCheckBoxItem
  • TCheckBoxList
  • TCircleHotSpot
  • TClientScript
  • TClientSideValidationSummaryOptions
  • TColorPicker
  • TColorPickerClientSide
  • TColorPickerMode
  • TCompareValidator
  • TCompleteWizardStep
  • TConditional
  • TContent
  • TContentDirection
  • TContentPlaceHolder
  • TCustomValidator
  • TDataBoundControl
  • TDataGrid
  • TDataGridColumn
  • TDataGridColumnCollection
  • TDataGridCommandEventParameter
  • TDataGridItem
  • TDataGridItemCollection
  • TDataGridItemEventParameter
  • TDataGridItemRenderer
  • TDataGridPageChangedEventParameter
  • TDataGridPager
  • TDataGridPagerButtonType
  • TDataGridPagerEventParameter
  • TDataGridPagerMode
  • TDataGridPagerPosition
  • TDataGridPagerStyle
  • TDataGridSortCommandEventParameter
  • TDataList
  • TDataListCommandEventParameter
  • TDataListItem
  • TDataListItemCollection
  • TDataListItemEventParameter
  • TDataListItemRenderer
  • TDataRenderer
  • TDataSize
  • TDataSourceControl
  • TDataSourceSelectParameters
  • TDataSourceView
  • TDataTypeValidator
  • TDatePicker
  • TDatePickerClientScript
  • TDatePickerInputMode
  • TDatePickerMode
  • TDatePickerPositionMode
  • TDisplayStyle
  • TDropDownList
  • TDropDownListColumn
  • TEditCommandColumn
  • TEmailAddressValidator
  • TExpression
  • TFileUpload
  • TFileUploadItem
  • TFlushOutput
  • TFont
  • TGravatar
  • THead
  • THeader1
  • THeader2
  • THeader3
  • THeader4
  • THeader5
  • THeader6
  • THiddenField
  • THorizontalAlign
  • THotSpot
  • THotSpotCollection
  • THotSpotMode
  • THtmlArea
  • THtmlArea5
  • THtmlElement
  • THyperLink
  • THyperLinkColumn
  • TImage
  • TImageButton
  • TImageClickEventParameter
  • TImageMap
  • TImageMapEventParameter
  • TInlineFrame
  • TInlineFrameAlign
  • TInlineFrameScrollBars
  • TItemDataRenderer
  • TJavascriptLogger
  • TKeyboard
  • TLabel
  • TLinkButton
  • TListBox
  • TListControl
  • TListControlValidator
  • TListItem
  • TListItemType
  • TListSelectionMode
  • TLiteral
  • TLiteralColumn
  • TMarkdown
  • TMetaTag
  • TMetaTagCollection
  • TMultiView
  • TOutputCache
  • TOutputCacheCalculateKeyEventParameter
  • TOutputCacheCheckDependencyEventParameter
  • TOutputCacheTextWriterMulti
  • TPageLoadTime
  • TPager
  • TPagerButtonType
  • TPagerMode
  • TPagerPageChangedEventParameter
  • TPanel
  • TPanelStyle
  • TPlaceHolder
  • TPolygonHotSpot
  • TRadioButton
  • TRadioButtonItem
  • TRadioButtonList
  • TRangeValidationDataType
  • TRangeValidator
  • TRatingList
  • TReadOnlyDataSource
  • TReadOnlyDataSourceView
  • TReCaptcha
  • TReCaptcha2
  • TReCaptcha2Validator
  • TReCaptchaValidator
  • TRectangleHotSpot
  • TRegularExpressionValidator
  • TRepeatDirection
  • TRepeater
  • TRepeaterCommandEventParameter
  • TRepeaterItem
  • TRepeaterItemCollection
  • TRepeaterItemEventParameter
  • TRepeaterItemRenderer
  • TRepeatInfo
  • TRepeatLayout
  • TRequiredFieldValidator
  • TSafeHtml
  • TScrollBars
  • TServerValidateEventParameter
  • TSlider
  • TSliderClientScript
  • TSliderDirection
  • TStatements
  • TStyle
  • TStyleSheet
  • TTable
  • TTableCaptionAlign
  • TTableCell
  • TTableCellCollection
  • TTableFooterRow
  • TTableGridLines
  • TTableHeaderCell
  • TTableHeaderRow
  • TTableHeaderScope
  • TTableItemStyle
  • TTableRow
  • TTableRowCollection
  • TTableRowSection
  • TTableStyle
  • TTabPanel
  • TTabView
  • TTabViewCollection
  • TTemplateColumn
  • TTemplatedWizardStep
  • TTextAlign
  • TTextBox
  • TTextBoxAutoCompleteType
  • TTextBoxMode
  • TTextHighlighter
  • TTextProcessor
  • TValidationCompareOperator
  • TValidationDataType
  • TValidationSummary
  • TValidationSummaryDisplayMode
  • TValidationSummaryDisplayStyle
  • TValidatorClientSide
  • TValidatorDisplayStyle
  • TVerticalAlign
  • TView
  • TViewCollection
  • TWebControl
  • TWebControlAdapter
  • TWebControlDecorator
  • TWizard
  • TWizardFinishNavigationTemplate
  • TWizardNavigationButtonStyle
  • TWizardNavigationButtonType
  • TWizardNavigationContainer
  • TWizardNavigationEventParameter
  • TWizardNavigationTemplate
  • TWizardSideBarListItemTemplate
  • TWizardSideBarTemplate
  • TWizardStartNavigationTemplate
  • TWizardStep
  • TWizardStepCollection
  • TWizardStepNavigationTemplate
  • TWizardStepType
  • TXmlTransform
  • TXmlDocument
  • TXmlElement
  • TXmlElementList

Interfaces

  • ICache
  • ICacheDependency
  • ICollectionFilter
  • IPriorityCapture
  • IPriorityCollection
  • IPriorityItem
  • IPriorityProperty
  • IWeakCollection
  • IWeakRetainable
  • IScaffoldEditRenderer
  • IMappedStatement
  • IMessageSource
  • IDataRenderer
  • IEventParameter
  • IModule
  • ITextWriter
  • IService
  • ISingleton
  • IStatePersister
  • IUser
  • IUserManager
  • IPermissions
  • IBaseBehavior
  • IBehavior
  • IClassBehavior
  • IDbModule
  • IDynamicMethods
  • IInstanceCheck
  • IOutputLogRoute
  • IPluginModule
  • IFeedContentProvider
  • IActiveControl
  • ICallbackEventHandler
  • IBindable
  • IBroadcastEventReceiver
  • IButtonControl
  • INamingContainer
  • IPageStatePersister
  • IPostBackDataHandler
  • IPostBackEventHandler
  • IRenderable
  • ISurroundable
  • ITemplate
  • ITheme
  • IValidatable
  • IValidator
  • IJuiOptions
  • IDataSource
  • IItemDataRenderer
  • IListControlAdapter
  • IRepeatInfoUser
  • IStyleable

Traits

  • TPriorityCollectionTrait
  • TPriorityPropertyTrait
  • TWeakCollectionTrait
  • TPermissionsManagerPropertyTrait
  • TNoUnserializeBehaviorTrait
  • TNoUnserializeClassBehaviorTrait

Search results

    • Namespaces
    • Errors
    • Deprecated
    • Markers

    Class \Prado\Web\UI\WebControls\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 \Prado\Web\UI\WebControls\setDataSource. The repeated contents in TDataList are called items, which are controls and can be accessed through \Prado\Web\UI\WebControls\getItems. When 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:

    • \Prado\Web\UI\WebControls\setItemTemplate, \Prado\Web\UI\WebControls\setItemRenderer: for each repeated row of data
    • \Prado\Web\UI\WebControls\setAlternatingItemTemplate, \Prado\Web\UI\WebControls\setAlternatingItemRenderer: for each alternating row of data. If not set, \Prado\Web\UI\WebControls\setItemTemplate or \Prado\Web\UI\WebControls\setItemRenderer will be used instead.
    • \Prado\Web\UI\WebControls\setHeaderTemplate, \Prado\Web\UI\WebControls\setHeaderRenderer: for the datalist header.
    • \Prado\Web\UI\WebControls\setFooterTemplate, \Prado\Web\UI\WebControls\setFooterRenderer: for the datalist footer.
    • \Prado\Web\UI\WebControls\setSeparatorTemplate, \Prado\Web\UI\WebControls\setSeparatorRenderer: for content to be displayed between items.
    • \Prado\Web\UI\WebControls\setEmptyTemplate, \Prado\Web\UI\WebControls\setEmptyRenderer: used when data bound to the datalist is empty.
    • \Prado\Web\UI\WebControls\setEditItemTemplate, \Prado\Web\UI\WebControls\setEditItemRenderer: for the row being editted.
    • \Prado\Web\UI\WebControls\setSelectedItemTemplate, \Prado\Web\UI\WebControls\setSelectedItemRenderer: for the row being selected.

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

    When 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 \Prado\Web\UI\WebControls\onItemCreated:
    • add the item as a child control
    • call dataBind() of the item
    • raise \Prado\Web\UI\WebControls\onItemDataBound:

    TDataList raises an \Prado\Web\UI\WebControls\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 \Prado\Web\UI\WebControls\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 \Prado\Web\UI\WebControls\setRepeatColumns property, while the \Prado\Web\UI\WebControls\setRepeatDirection governs the order of the items being rendered. The layout of the data items in the list is specified via \Prado\Web\UI\WebControls\setRepeatLayout, 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 \Prado\Web\UI\WebControls\setCellPadding and \Prado\Web\UI\WebControls\setCellSpacing to adjust the cellpadding and cellpadding of the table, and \Prado\Web\UI\WebControls\setCaption and \Prado\Web\UI\WebControls\setCaptionAlign 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 \Prado\Web\UI\WebControls\setSelectedItemIndex or \Prado\Web\UI\WebControls\setEditItemIndex. The former will change the indicated item to selected mode, which will cause the item to use \Prado\Web\UI\WebControls\setSelectedItemTemplate or \Prado\Web\UI\WebControls\setSelectedItemRenderer 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
    • \Prado\Web\UI\WebControls\getItemStyle
    • \Prado\Web\UI\WebControls\getAlternatingItemStyle
    • \Prado\Web\UI\WebControls\getSelectedItemStyle
    • \Prado\Web\UI\WebControls\getEditItemStyle. Therefore, if background color is set as red in \Prado\Web\UI\WebControls\getItemStyle, \Prado\Web\UI\WebControls\getEditItemStyle 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 \Prado\Web\UI\WebControls\getDataKeys 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.

    Class hierarchy

    \Prado\Web\UI\WebControls\TDataList implements INamingContainer, IRepeatInfoUser
    Extended by \Prado\Web\UI\WebControls\TBaseDataList
    Extended by \Prado\Web\UI\WebControls\TDataBoundControl
    Extended by \Prado\Web\UI\WebControls\TWebControl implements IStyleable
    Extended by \Prado\Web\UI\TControl implements IRenderable, IBindable
    Extended by \Prado\TApplicationComponent
    Extended by \Prado\TComponent
    Author: Qiang Xue <qiang.xue@gmail.com>
    Since: 3.0
    Methods summary
    public
    bubbleEvent(TControl $sender, TEventParameter $param) : bool
    This method overrides parent's implementation to handle {@see 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 \Prado\Web\UI\WebControls\onEditCommand). This method should only be used by control developers.

    public
    generateItemStyle(string $itemType, int $index) : TStyle
    Returns a style used for rendering items.

    This method is required by IRepeatInfoUser interface.

    public
    getAlternatingItemRenderer() : string
    public
    getAlternatingItemStyle() : TTableItemStyle
    public
    getAlternatingItemTemplate() : ITemplate
    public
    getCaption() : string
    public deprecated
    getCaptionAlign() : TTableCaptionAlign
    public
    getEditItem() : TControl
    public
    getEditItemIndex() : int
    public
    getEditItemRenderer() : string
    public
    getEditItemStyle() : TTableItemStyle
    public
    getEditItemTemplate() : ITemplate
    public
    getEmptyRenderer() : string
    public
    getEmptyTemplate() : ITemplate
    public
    getFooter() : TControl
    public
    getFooterRenderer() : string
    public
    getFooterStyle() : TTableItemStyle
    public
    getFooterTemplate() : ITemplate
    public
    getHasFooter() : bool
    Returns a value indicating whether this control contains footer item.

    This method is required by IRepeatInfoUser interface.

    public
    getHasHeader() : bool
    Returns a value indicating whether this control contains header item.

    This method is required by IRepeatInfoUser interface.

    public
    getHasSeparators() : bool
    Returns a value indicating whether this control contains separator items.

    This method is required by IRepeatInfoUser interface.

    public
    getHeader() : TControl
    public
    getHeaderRenderer() : string
    public
    getHeaderStyle() : TTableItemStyle
    public
    getHeaderTemplate() : ITemplate
    public
    getItemCount() : int
    public
    getItemRenderer() : string
    public
    getItems() : TDataListItemCollection
    public
    getItemStyle() : TTableItemStyle
    public
    getItemTemplate() : ITemplate
    public
    getRepeatColumns() : int
    public
    getRepeatDirection() : TRepeatDirection
    public
    getRepeatLayout() : TRepeatLayout
    public
    getSelectedDataKey() : mixed
    public
    getSelectedItem() : TControl
    public
    getSelectedItemIndex() : int
    public
    getSelectedItemRenderer() : string
    public
    getSelectedItemStyle() : TTableItemStyle
    public
    getSelectedItemTemplate() : ITemplate
    public
    getSeparatorRenderer() : string
    public
    getSeparatorStyle() : TTableItemStyle
    public
    getSeparatorTemplate() : ITemplate
    public
    getShowFooter() : bool
    public
    getShowHeader() : bool
    public
    loadState() : mixed
    Loads item count information from viewstate.

    This method is invoked right after control state is loaded.

    public
    onCancelCommand(TDataListCommandEventParameter $param) : mixed
    Raises <b>OnCancelCommand</b> 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).

    public
    onDeleteCommand(TDataListCommandEventParameter $param) : mixed
    Raises <b>OnDeleteCommand</b> 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).

    public
    onEditCommand(TDataListCommandEventParameter $param) : mixed
    Raises <b>OnEditCommand</b> 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).

    public
    onItemCommand(TDataListCommandEventParameter $param) : mixed
    Raises <b>OnItemCommand</b> event.

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

    public
    onItemCreated(TDataListItemEventParameter $param) : mixed
    Raises <b>OnItemCreated</b> 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.

    public
    onItemDataBound(TDataListItemEventParameter $param) : mixed
    Raises <b>OnItemDataBound</b> 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.

    public
    onUpdateCommand(TDataListCommandEventParameter $param) : mixed
    Raises <b>OnUpdateCommand</b> 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).

    public
    render(THtmlWriter $writer) : mixed
    Renders the data list control.

    This method overrides the parent implementation.

    public
    renderItem(THtmlWriter $writer, TRepeatInfo $repeatInfo, string $itemType, int $index) : mixed
    Renders an item in the list.

    This method is required by IRepeatInfoUser interface.

    public
    reset() : mixed
    Clears up all items in the data list.
    public
    saveState() : mixed
    Saves item count in viewstate.

    This method is invoked right before control state is to be saved.

    public
    setAlternatingItemRenderer(string $value) : mixed
    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 \Prado\Web\UI\WebControls\getAlternatingItemTemplate.

    public
    setAlternatingItemTemplate(ITemplate $value) : mixed
    public
    setCaption(string $value) : mixed
    public deprecated
    setCaptionAlign(TTableCaptionAlign $value) : mixed
    public
    setEditItemIndex(int $value) : mixed
    Edits an item by its index in {@see 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.

    public
    setEditItemRenderer(string $value) : mixed
    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 \Prado\Web\UI\WebControls\getEditItemTemplate.

    public
    setEditItemTemplate(ITemplate $value) : mixed
    public
    setEmptyRenderer(string $value) : mixed
    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 \Prado\Web\UI\WebControls\getEmptyTemplate.

    public
    setEmptyTemplate(ITemplate $value) : mixed
    public
    setFooterRenderer(string $value) : mixed
    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 \Prado\Web\UI\WebControls\getFooterTemplate.

    public
    setFooterTemplate(ITemplate $value) : mixed
    public
    setHeaderRenderer(string $value) : mixed
    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 \Prado\Web\UI\WebControls\getHeaderTemplate.

    public
    setHeaderTemplate(ITemplate $value) : mixed
    public
    setItemRenderer(string $value) : mixed
    Sets the item renderer class.

    If not empty, the class will be used to instantiate as datalist items. This property takes precedence over \Prado\Web\UI\WebControls\getItemTemplate.

    public
    setItemTemplate(ITemplate $value) : mixed
    public
    setRepeatColumns(int $value) : mixed
    public
    setRepeatDirection(TRepeatDirection $value) : mixed
    public
    setRepeatLayout(TRepeatLayout $value) : mixed
    public
    setSelectedItemIndex(int $value) : mixed
    Selects an item by its index in {@see 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.

    public
    setSelectedItemRenderer(string $value) : mixed
    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 \Prado\Web\UI\WebControls\getSelectedItemTemplate.

    public
    setSelectedItemTemplate(ITemplate $value) : mixed
    public
    setSeparatorRenderer(string $value) : mixed
    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 \Prado\Web\UI\WebControls\getSeparatorTemplate.

    public
    setSeparatorTemplate(ITemplate $value) : mixed
    public
    setShowFooter(bool $value) : mixed
    public
    setShowHeader(bool $value) : mixed
    protected
    applyItemStyles() : mixed
    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, \Prado\Web\UI\WebControls\getItemStyle, \Prado\Web\UI\WebControls\getAlternatingItemStyle, \Prado\Web\UI\WebControls\getSelectedItemStyle, and \Prado\Web\UI\WebControls\getEditItemStyle. Therefore, if background color is set as red in \Prado\Web\UI\WebControls\getItemStyle, \Prado\Web\UI\WebControls\getEditItemStyle will also have red background color unless it is set to a different value explicitly.

    protected
    createEmptyContent() : mixed
    Creates empty datalist content.
    protected
    createItem(int $itemIndex, TListItemType $itemType) : TControl
    Creates a datalist item instance based on the item type and index.
    protected
    getRepeatInfo() : TRepeatInfo
    protected
    performDataBinding(Traversable $data) : mixed
    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.

    protected
    restoreItemsFromViewState() : mixed
    Creates data list items based on viewstate information.
    private
    createItemInternal(int $itemIndex, TListItemType $itemType) : TControl
    Creates a datalist item.

    This method invokes createItem to create a new datalist item.

    private
    createItemWithDataInternal(int $itemIndex, TListItemType $itemType, mixed $dataItem) : TControl
    Creates a datalist item and performs databinding.

    This method invokes createItem to create a new datalist item.

    private
    getAlternatingItemDisplay() : mixed
    private
    getEditItemDisplay(mixed $itemIndex) : mixed
    private
    getItem(TListItemType $itemType, int $index) : TDataListItem
    private
    getSelectedItemDisplay(mixed $itemIndex) : mixed
    Inherited methods
    __call, __callStatic, __clone, __construct, __destruct, __get, __isset, __set, __sleep, __unset, __wakeup, addedControl, addParsedObject, applyStyleSheetSkin, asa, attachBehavior, attachBehaviors, attachClassBehavior, attachEventHandler, autoBindProperty, bindProperty, broadcastEvent, bubbleEvent, callBehaviorsMethod, canGetProperty, canSetProperty, clearBehaviors, clearNamingContainer, clearStyle, clearViewState, convertUniqueIdToClientId, copyBaseAttributes, createChildControls, createdOnTemplate, dataBind, dataSourceViewChanged, detachBehavior, detachBehaviors, detachClassBehavior, detachEventHandler, disableBehavior, disableBehaviors, enableBehavior, enableBehaviors, ensureChildControls, evaluateExpression, evaluateStatements, findControl, findControlsByID, findControlsByType, focus, fxAttachClassBehavior, fxDetachClassBehavior, getAccessKey, getAdapter, getAllowChildControls, getAllowCustomPaging, getAllowPaging, getApplication, getAttribute, getAttributes, getAutoGlobalListen, getBackColor, getBehaviors, getBehaviorsEnabled, getBorderColor, getBorderStyle, getBorderWidth, getCellPadding, getCellSpacing, getClassHierarchy, getClientID, getControls, getCssClass, getCurrentPageIndex, getCustomData, getDataKeyField, getDataKeys, getDataMember, getDataSource, getDataSourceID, getDecorator, getDisplay, getEnabled, getEnableTheming, getEnableViewState, getEnsureId, getEventHandlers, getFont, getForeColor, getGridLines, getHasAdapter, getHasAttributes, getHasChildInitialized, getHasControls, getHasInitialized, getHasLoaded, getHasLoadedPostData, getHasPreRendered, getHasStyle, getHeight, getHorizontalAlign, getID, getIsSkinApplied, getListeningToGlobalEvents, getNamingContainer, getPage, getPageCount, getPageSize, getParent, getPluginModule, getRegisteredObject, getRequest, getResponse, getSelectParameters, getService, getSession, getSkinID, getSourceTemplateControl, getStyle, getSubProperty, getTabIndex, getTemplateControl, getToolTip, getUniqueID, getUser, getViewState, getVirtualItemCount, getVisible, getWidth, hasAttribute, hasEvent, hasEventHandler, hasMethod, hasProperty, isa, isObjectRegistered, listen, loadState, onDataBinding, onDataBound, onDataSourceChanged, onInit, onLoad, onPreRender, onSelectedIndexChanged, onUnload, pagePreLoad, publishAsset, publishFilePath, raiseEvent, registerObject, removeAttribute, removedControl, render, renderBeginTag, renderChildren, renderContents, renderControl, renderEndTag, saveState, setAccessKey, setAdapter, setAllowCustomPaging, setAllowPaging, setAttribute, setBackColor, setBorderColor, setBorderStyle, setBorderWidth, setCellPadding, setCellSpacing, setCssClass, setCurrentPageIndex, setCustomData, setDataKeyField, setDataMember, setDataSource, setDataSourceID, setDisplay, setEnabled, setEnableTheming, setEnableViewState, setEnsureId, setForeColor, setGridLines, setHeight, setHorizontalAlign, setID, setPage, setPageSize, setSkinID, setStyle, setSubProperty, setTabIndex, setTemplateControl, setToolTip, setViewState, setVirtualItemCount, setVisible, setWidth, trackViewState, unbindProperty, unlisten, unregisterObject, _getZappableSleepProps, addAttributesToRender, autoDataBindProperties, clearChildState, clearControlState, createControlCollection, createPagedDataSource, createStyle, dataBindChildren, dataBindProperties, determineDataSource, ensureDataBound, getCallChain, getChildControlsCreated, getClassFxEvents, getControlStage, getControlState, getDataFieldValue, getDataSourceView, getInitialized, getIsDataBound, getRequiresDataBinding, getTagName, getUsingDataSourceID, initRecursive, instanceBehavior, isDescendentOf, loadRecursive, loadStateRecursive, performDataBinding, preRenderRecursive, raiseBubbleEvent, saveStateRecursive, setChildControlsCreated, setControlStage, setControlState, setInitialized, setIsDataBound, setRequiresDataBinding, traverseChildControls, unloadRecursive, validateDataSource, broadcastEventInternal, clearCachedUniqueID, clearNameTable, fillNameTable, filter_prado_fx, generateAutomaticID
    Constants summary
    public mixed CMD_CANCEL
    'Cancel'
    public mixed CMD_DELETE
    'Delete'
    public mixed CMD_EDIT
    'Edit'
    public mixed CMD_SELECT
    Command name that TDataList understands. They are case-insensitive.
    'Select'
    public mixed CMD_UPDATE
    'Update'
    Inherited constants
    \Prado\Web\UI\TControl::AUTOMATIC_ID_PREFIX, \Prado\Web\UI\TControl::CLIENT_ID_SEPARATOR, \Prado\Web\UI\TControl::CS_CHILD_INITIALIZED, \Prado\Web\UI\TControl::CS_CONSTRUCTED, \Prado\Web\UI\TControl::CS_INITIALIZED, \Prado\Web\UI\TControl::CS_LOADED, \Prado\Web\UI\TControl::CS_PRERENDERED, \Prado\Web\UI\TControl::CS_STATE_LOADED, \Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER, \Prado\Web\UI\TControl::ID_FORMAT, \Prado\Web\UI\TControl::ID_SEPARATOR, \Prado\Web\UI\TControl::IS_CHILD_CREATED, \Prado\Web\UI\TControl::IS_CREATING_CHILD, \Prado\Web\UI\TControl::IS_DISABLE_THEMING, \Prado\Web\UI\TControl::IS_DISABLE_VIEWSTATE, \Prado\Web\UI\TControl::IS_ID_SET, \Prado\Web\UI\TControl::IS_SKIN_APPLIED, \Prado\Web\UI\TControl::IS_STYLESHEET_APPLIED, \Prado\Web\UI\TControl::RF_ADAPTER, \Prado\Web\UI\TControl::RF_AUTO_BINDINGS, \Prado\Web\UI\TControl::RF_CHILD_STATE, \Prado\Web\UI\TControl::RF_CONTROLS, \Prado\Web\UI\TControl::RF_CONTROLSTATE, \Prado\Web\UI\TControl::RF_DATA_BINDINGS, \Prado\Web\UI\TControl::RF_EVENTS, \Prado\Web\UI\TControl::RF_NAMED_CONTROLS, \Prado\Web\UI\TControl::RF_NAMED_CONTROLS_ID, \Prado\Web\UI\TControl::RF_NAMED_OBJECTS, \Prado\Web\UI\TControl::RF_SKIN_ID
    Prado 4.3.0 API Manual