Class \Prado\Web\UI\ActiveControls\TActiveDataGrid
TActiveDataGrid represents a data bound and updatable grid control which is the active counterpart to the original 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
- TActiveBoundColumn, the active counterpart to TBoundColumn.
- TActiveLiteralColumn, the active counterpart to TLiteralColumn.
- TActiveCheckBoxColumn, the active counterpart to TCheckBoxColumn.
- TActiveDropDownListColumn, the active counterpart to TDropDownListColumn.
- TActiveHyperLinkColumn, the active counterpart to THyperLinkColumn.
- TActiveEditCommandColumn, the active counterpart to TEditCommandColumn.
- TActiveButtonColumn, the active counterpart to TButtonColumn.
- TActiveTemplateColumn, the active counterpart to TTemplateColumn.
Please refer to the original documentation of the regular counterparts for usage.
Class hierarchy
- \Prado\Web\UI\ActiveControls\TActiveDataGrid implements IActiveControl, ISurroundable
- \Prado\Web\UI\WebControls\TDataGrid implements INamingContainer
- \Prado\Web\UI\WebControls\TBaseDataList
- \Prado\Web\UI\WebControls\TDataBoundControl
- \Prado\Web\UI\WebControls\TWebControl implements IStyleable
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.1.9
public
|
|
public
|
|
public
|
getSurroundingTag() : string
Gets the tag used to render the surrounding container. Defaults to 'div'.
|
public
|
|
public
|
render(THtmlWriter $writer) : mixed
Renders the datagrid.
If the datagrid did not pass the prerender phase yet, it will register itself for rendering later. Else it will call the renderDataGrid() method which will do the rendering of the datagrid. |
public
|
setDataSource(array<string|int, mixed>|string|Traversable $value) : mixed
Sets the data source object associated with the datagrid control.
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
|
|
protected
|
|
protected
|
createPagerButton(mixed $pager, string $buttonType, bool $enabled, string $text, string $commandName, string $commandParameter) : mixed
Creates a pager button.
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
|
|
private
|
renderDataGrid(THtmlWriter $writer) : mixed
Renders the datagrid by writing a {@see getSurroundingTag()} with the container id obtained
from {@see getSurroundingTagId()} which will be called by the replacement method of the client
script to update it's content.
|
private
|
renderPager() : mixed
Loops through all {@see \Prado\Web\UI\ActiveControls\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.
|