PHP 클래스 Prado\Web\UI\WebControls\TDataBoundControl

TDataBoundControl is the based class for controls that need to populate data from data sources. It provides basic properties and methods that allow the derived controls to associate with data sources and retrieve data from them. TBC.... TDataBoundControl is equipped with paging capabilities. By setting {@link setAllowPaging AllowPaging} to true, the input data will be paged and only one page of data is actually populated into the data-bound control. This saves a lot of memory when dealing with larget datasets. To specify the number of data items displayed on each page, set the {@link setPageSize PageSize} property, and to specify which page of data to be displayed, set {@link setCurrentPageIndex CurrentPageIndex}. When the size of the original data is too big to be loaded all in the memory, one can enable custom paging. In custom paging, the total number of data items is specified manually via {@link setVirtualItemCount VirtualItemCount}, and the data source only needs to contain the current page of data. To enable custom paging, set {@link setAllowCustomPaging AllowCustomPaging} to true.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends TWebControl
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
dataBind ( ) Performs databinding.
dataSourceViewChanged ( $sender, $param )
getAllowCustomPaging ( ) : boolean
getAllowPaging ( ) : boolean
getCurrentPageIndex ( ) : integer
getDataMember ( )
getDataSource ( ) : Traversable
getDataSourceID ( ) : string
getPageCount ( ) : integer
getPageSize ( ) : integer
getSelectParameters ( )
getVirtualItemCount ( ) : integer
onDataBound ( $param ) Raises OnDataBound event.
onDataSourceChanged ( ) Sets {@link setRequiresDataBinding RequiresDataBinding} as true if the control is initialized.
onInit ( $param ) Sets page's OnPreLoad event handler as {@link pagePreLoad}.
onPreRender ( $param ) Ensures any pending databind is performed.
pagePreLoad ( $sender, $param ) Sets {@link getInitialized} as true.
setAllowCustomPaging ( $value ) Sets a value indicating whether the custom paging should be enabled.
setAllowPaging ( $value )
setCurrentPageIndex ( $value )
setDataMember ( $value )
setDataSource ( $value ) Sets the data source object associated with the databound control.
setDataSourceID ( $value )
setPageSize ( $value )
setVirtualItemCount ( $value )

보호된 메소드들

메소드 설명
createPagedDataSource ( ) : TPagedDataSource
determineDataSource ( )
ensureDataBound ( ) Ensures any pending {@link dataBind} is called.
getDataSourceView ( )
getInitialized ( ) : boolean
getIsDataBound ( ) : boolean
getRequiresDataBinding ( ) : boolean
getUsingDataSourceID ( ) : boolean
performDataBinding ( $data )
setInitialized ( $value ) Sets a value indicating whether the databound control is initialized.
setIsDataBound ( $value )
setRequiresDataBinding ( $value ) Sets a value indicating whether a databind call is required by the data bound control.
validateDataSource ( $value ) : Traversable Validates if the parameter is a valid data source.

메소드 상세

createPagedDataSource() 보호된 메소드

protected createPagedDataSource ( ) : TPagedDataSource
리턴 Prado\Collections\TPagedDataSource creates a paged data source

dataBind() 공개 메소드

This method overrides the parent implementation by calling {@link performSelect} which fetches data from data source and does the actual binding work.
public dataBind ( )

dataSourceViewChanged() 공개 메소드

public dataSourceViewChanged ( $sender, $param )

determineDataSource() 보호된 메소드

protected determineDataSource ( )

ensureDataBound() 보호된 메소드

This method calls {@link dataBind} if the data source is specified by {@link setDataSourceID} or if {@link getRequiresDataBinding RequiresDataBinding} is true.
protected ensureDataBound ( )

getAllowCustomPaging() 공개 메소드

public getAllowCustomPaging ( ) : boolean
리턴 boolean whether the custom paging is enabled. Defaults to false.

getAllowPaging() 공개 메소드

public getAllowPaging ( ) : boolean
리턴 boolean whether paging is enabled. Defaults to false.

getCurrentPageIndex() 공개 메소드

public getCurrentPageIndex ( ) : integer
리턴 integer the zero-based index of the current page. Defaults to 0.

getDataMember() 공개 메소드

public getDataMember ( )

getDataSource() 공개 메소드

public getDataSource ( ) : Traversable
리턴 Traversable data source object, defaults to null.

getDataSourceID() 공개 메소드

public getDataSourceID ( ) : string
리턴 string ID path to the data source control. Defaults to empty.

getDataSourceView() 보호된 메소드

protected getDataSourceView ( )

getInitialized() 보호된 메소드

protected getInitialized ( ) : boolean
리턴 boolean whether the databound control has been initialized. By default, the control is initialized after its viewstate has been restored.

getIsDataBound() 보호된 메소드

protected getIsDataBound ( ) : boolean
리턴 boolean whether databind has been invoked in the previous page request

getPageCount() 공개 메소드

public getPageCount ( ) : integer
리턴 integer number of pages of data items available

getPageSize() 공개 메소드

public getPageSize ( ) : integer
리턴 integer the number of data items on each page. Defaults to 10.

getRequiresDataBinding() 보호된 메소드

protected getRequiresDataBinding ( ) : boolean
리턴 boolean whether a databind call is required (by the data bound control)

getSelectParameters() 공개 메소드

public getSelectParameters ( )

getUsingDataSourceID() 보호된 메소드

protected getUsingDataSourceID ( ) : boolean
리턴 boolean if the databound control uses the data source specified by {@link setDataSourceID}, or it uses the data source object specified by {@link setDataSource}.

getVirtualItemCount() 공개 메소드

또한 보기: setAllowCustomPaging
public getVirtualItemCount ( ) : integer
리턴 integer virtual number of data items in the data source. Defaults to 0.

onDataBound() 공개 메소드

This method should be invoked after a databind is performed. It is mainly used by framework and component developers.
public onDataBound ( $param )

onDataSourceChanged() 공개 메소드

This method is invoked when either {@link setDataSource} or {@link setDataSourceID} is changed.
public onDataSourceChanged ( )

onInit() 공개 메소드

If viewstate is disabled and the current request is a postback, {@link setRequiresDataBinding RequiresDataBinding} will be set true. This method overrides the parent implementation.
public onInit ( $param )

onPreRender() 공개 메소드

This method overrides the parent implementation.
public onPreRender ( $param )

pagePreLoad() 공개 메소드

This method is invoked when page raises PreLoad event.
public pagePreLoad ( $sender, $param )

performDataBinding() 추상적인 보호된 메소드

abstract protected performDataBinding ( $data )

setAllowCustomPaging() 공개 메소드

When the pager is in custom paging mode, the {@link setVirtualItemCount VirtualItemCount} property is used to determine the paging, and the data items in the {@link setDataSource DataSource} are considered to be in the current page.
public setAllowCustomPaging ( $value )

setAllowPaging() 공개 메소드

public setAllowPaging ( $value )

setCurrentPageIndex() 공개 메소드

public setCurrentPageIndex ( $value )

setDataMember() 공개 메소드

public setDataMember ( $value )

setDataSource() 공개 메소드

The data source must implement Traversable interface. If an array is given, it will be converted to xxx. If a string is given, it will be converted to xxx.
public setDataSource ( $value )

setDataSourceID() 공개 메소드

public setDataSourceID ( $value )

setInitialized() 보호된 메소드

If initialized, any modification to {@link setDataSource DataSource} or {@link setDataSourceID DataSourceID} will set {@link setRequiresDataBinding RequiresDataBinding} as true.
protected setInitialized ( $value )

setIsDataBound() 보호된 메소드

protected setIsDataBound ( $value )

setPageSize() 공개 메소드

public setPageSize ( $value )

setRequiresDataBinding() 보호된 메소드

If true and the control has been prerendered while it uses the data source specified by {@link setDataSourceID}, a databind call will be called by this method.
protected setRequiresDataBinding ( $value )

setVirtualItemCount() 공개 메소드

또한 보기: setAllowCustomPaging
public setVirtualItemCount ( $value )

validateDataSource() 보호된 메소드

If it is a string or an array, it will be converted as a TList object.
protected validateDataSource ( $value ) : Traversable
리턴 Traversable the data that is traversable