PHP Class Prado\Data\ActiveRecord\Scaffold\TScaffoldListView

The {@link getHeader Header} property is a TRepeater displaying the Active Record property/field names. The {@link getSort Sort} property is a drop down list displaying the combination of properties and its possible ordering. The {@link getPager Pager} property is a TPager control displaying the links and/or buttons that navigate to different pages in the Active Record data. The {@link getList List} property is a TRepeater that renders a row of Active Record data. Custom rendering of the each Active Record can be achieved by specifying the ItemTemplate or AlternatingItemTemplate property of the main {@linnk getList List} repeater. The TScaffoldListView will listen for two command events named "delete" and "edit". A "delete" command will delete a the record for the row where the "delete" command is originates. An "edit" command will push the record data to be edited by a TScaffoldEditView with ID specified by the {@link setEditViewID EditViewID}. Additional {@link setSearchCondition SearchCondition} and {@link setSearchParameters SearchParameters} (takes array values) can be specified to customize the records to be shown. The {@link setSearchCondition SearchCondition} will be used as the Condition property of TActiveRecordCriteria, and similarly the {@link setSearchParameters SearchParameters} will be the corresponding Parameters property of TActiveRecordCriteria.
Since: 3.1
Inheritance: extends TScaffoldBase
Show file Open project: pradosoft/prado

Public Methods

Method Description
bubbleEvent ( $sender, $param ) Continue bubbling the "edit" command, "delete" command is handled in this class.
getEditViewID ( ) : string
getHeader ( ) : TRepeater
getList ( ) : TRepeater
getPager ( ) : TPager
getSearchCondition ( )
getSearchParameters ( ) : array
getSort ( ) : TDropDownList
onPreRender ( $param ) Loads and display the data.
setEditViewID ( $value )
setSearchCondition ( $value )
setSearchParameters ( $value )

Protected Methods

Method Description
deleteRecord ( $sender, $param ) Deletes an Active Record.
getEditViewControl ( ) : TScaffoldEditView
getRecordCriteria ( ) : Prado\Data\ActiveRecord\TActiveRecordCriteria
initializeEdit ( $sender, $param ) Initialize the edit view control form when EditViewID is set.
initializeSort ( ) Initialize the sort drop down list and the column names repeater.
listItemCreated ( $sender, $param ) Initialize the default display for each Active Record item.
loadRecordData ( ) Fetch the records and data bind it to the list.
pageChanged ( $sender, $param ) Updates repeater page index with the pager new index value.
populateField ( $sender, $param ) Sets the Record primary key to the current repeater item's CustomData.

Method Details

bubbleEvent() public method

Continue bubbling the "edit" command, "delete" command is handled in this class.
public bubbleEvent ( $sender, $param )

deleteRecord() protected method

Deletes an Active Record.
protected deleteRecord ( $sender, $param )

getEditViewControl() protected method

protected getEditViewControl ( ) : TScaffoldEditView
return TScaffoldEditView control for editing selected Active Record, null if EditViewID is not set.

getEditViewID() public method

public getEditViewID ( ) : string
return string TScaffoldEditView control ID for editing selected Active Record.

getHeader() public method

public getHeader ( ) : TRepeater
return TRepeater Repeater control for record property names.

getList() public method

public getList ( ) : TRepeater
return TRepeater Repeater control for Active Record instances.

getPager() public method

public getPager ( ) : TPager
return TPager List pager control.

getRecordCriteria() protected method

protected getRecordCriteria ( ) : Prado\Data\ActiveRecord\TActiveRecordCriteria
return Prado\Data\ActiveRecord\TActiveRecordCriteria sort/search/paging criteria

getSearchCondition() public method

public getSearchCondition ( )

getSearchParameters() public method

public getSearchParameters ( ) : array
return array search parameters

getSort() public method

public getSort ( ) : TDropDownList
return TDropDownList Control that displays and controls the record ordering.

initializeEdit() protected method

Initialize the edit view control form when EditViewID is set.
protected initializeEdit ( $sender, $param )

initializeSort() protected method

Initialize the sort drop down list and the column names repeater.
protected initializeSort ( )

listItemCreated() protected method

Initialize the default display for each Active Record item.
protected listItemCreated ( $sender, $param )

loadRecordData() protected method

Fetch the records and data bind it to the list.
protected loadRecordData ( )

onPreRender() public method

Loads and display the data.
public onPreRender ( $param )

pageChanged() protected method

Updates repeater page index with the pager new index value.
protected pageChanged ( $sender, $param )

populateField() protected method

Binds the inner repeater with properties of the current Active Record.
protected populateField ( $sender, $param )

setEditViewID() public method

public setEditViewID ( $value )

setSearchCondition() public method

public setSearchCondition ( $value )

setSearchParameters() public method

public setSearchParameters ( $value )