PHP Class Prado\Web\UI\ActiveControls\TActiveDataGrid

TActiveDataGrid represents a data bound and updatable grid control which is the active counterpart to the original {@link TDataGrid} control. This component can be used in the same way as the regular datagrid, the only difference is that the active datagrid uses callbacks instead of postbacks for interaction. There are also active datagrid columns to work with the TActiveDataGrid, which are - {@link TActiveBoundColumn}, the active counterpart to {@link TBoundColumn}. - {@link TActiveLiteralColumn}, the active counterpart to {@link TLiteralColumn}. - {@link TActiveCheckBoxColumn}, the active counterpart to {@link TCheckBoxColumn}. - {@link TActiveDropDownListColumn}, the active counterpart to {@link TDropDownListColumn}. - {@link TActiveHyperLinkColumn}, the active counterpart to {@link THyperLinkColumn}. - {@link TActiveEditCommandColumn}, the active counterpart to {@link TEditCommandColumn}. - {@link TActiveButtonColumn}, the active counterpart to {@link TButtonColumn}. - {@link TActiveTemplateColumn}, the active counterpart to {@link TTemplateColumn}. Please refer to the original documentation of the regular counterparts for usage.
Since: 3.1.9
Author: LANDWEHR Computer und Software GmbH ([email protected])
Inheritance: extends Prado\Web\UI\WebControls\TDataGrid, implements Prado\Web\UI\ActiveControls\IActiveControl, implements Prado\Web\UI\ISurroundable
Datei anzeigen Open project: pradosoft/prado

Protected Properties

Property Type Description
$_surroundingTag the tag used to render the surrounding container

Public Methods

Method Description
__construct ( ) Creates a new callback control, sets the adapter to TActiveControlAdapter.
getActiveControl ( ) : TBaseActiveControl
getSurroundingTag ( ) : string Gets the tag used to render the surrounding container. Defaults to 'div'.
getSurroundingTagID ( ) : string Returns the id of the surrounding container.
render ( $writer ) Renders the datagrid.
setDataSource ( $value ) Sets the data source object associated with the datagrid control.
setSurroundingTag ( string $value ) Sets the tag used to render the surrounding container.

Protected Methods

Method Description
createPager ( )
createPagerButton ( $pager, $buttonType, $enabled, $text, $commandName, $commandParameter ) : mixed Creates a pager button.
getAutoGenerateColumnName ( ) : string

Private Methods

Method Description
renderDataGrid ( $writer ) Renders the datagrid by writing a {@link getSurroundingTag()} with the container id obtained from {@link getSurroundingTagId()} which will be called by the replacement method of the client script to update it's content.
renderPager ( ) Loops through all {@link TActivePager} on the page and registers the ones which are set to paginate the datagrid for rendering. This is to ensure that the connected pagers are also rendered if the data source changed.

Method Details

__construct() public method

Creates a new callback control, sets the adapter to TActiveControlAdapter.
public __construct ( )

createPager() protected method

protected createPager ( )

createPagerButton() protected method

Depending on the button type, a TActiveLinkButton or a TActiveButton may be created. If it is enabled (clickable), its command name and parameter will also be set. It overrides the datagrid's original method to create active controls instead, thus the pager will do callbacks instead of the regular postbacks.
protected createPagerButton ( $pager, $buttonType, $enabled, $text, $commandName, $commandParameter ) : mixed
return mixed the button instance

getActiveControl() public method

public getActiveControl ( ) : TBaseActiveControl
return TBaseActiveControl standard active control options.

getAutoGenerateColumnName() protected method

protected getAutoGenerateColumnName ( ) : string
return string Name of the class used in AutoGenerateColumns mode

getSurroundingTag() public method

Gets the tag used to render the surrounding container. Defaults to 'div'.
public getSurroundingTag ( ) : string
return string container tag

getSurroundingTagID() public method

Returns the id of the surrounding container.
public getSurroundingTagID ( ) : string
return string container id

render() public method

If the datagrid did not pass the prerender phase yet, it will register itself for rendering later. Else it will call the {@link renderDataGrid()} method which will do the rendering of the datagrid.
public render ( $writer )

setDataSource() public method

In addition, the render method of all connected pagers is called so they get updated when the data source is changed. Also the datagrid registers itself for rendering in order to get it's content replaced on client side.
public setDataSource ( $value )

setSurroundingTag() public method

Sets the tag used to render the surrounding container.
public setSurroundingTag ( string $value )
$value string container tag

Property Details

$_surroundingTag protected_oe property

the tag used to render the surrounding container
protected $_surroundingTag