Class \Prado\Web\UI\ActiveControls\TActiveTableCell
TActiveTableCell is the active counterpart to the original TTableCell control and displays a table cell. The horizontal and vertical alignments of the cell are specified via \Prado\Web\UI\ActiveControls\setHorizontalAlign and \Prado\Web\UI\ActiveControls\setVerticalAlign properties, respectively.
TActiveTableCell allows the contents of the table cell to be changed during callback. When \Prado\Web\UI\ActiveControls\onCellSelected property is set, selecting (clicking on) the cell will perform a callback request causing \Prado\Web\UI\ActiveControls\onCellSelected event to be fired.
It will also bubble the \Prado\Web\UI\ActiveControls\onCellSelected event up to it's parent TActiveTableRow control which will fire up the event handlers if implemented.
TActiveTableCell allows the client-side cell contents to be updated during a callback response by getting a new writer, invoking the render method and flushing the output, similar to a TActivePanel control.
function callback_request($sender, $param)
{
$this->active_cell->render($param->getNewWriter());
}
Please refer to the original documentation of the regular counterpart for usage.
Class hierarchy
- \Prado\Web\UI\ActiveControls\TActiveTableCell implements IActiveControl, ICallbackEventHandler
- \Prado\Web\UI\WebControls\TTableCell implements IDataRenderer
- \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
|
getCellIndex() : int
Returns the zero-based index of the TActiveTableCell within the {@see \Prado\Web\UI\WebControls\TTableCellCollection}
of the parent {@see \Prado\Web\UI\WebControls\TTableRow} control. Raises a {@see \Prado\Exceptions\TConfigurationException} if the cell
is no member of the cell collection.
|
public
|
|
public
|
|
public
|
onCellSelected(TActiveTableCellEventParameter $param) : mixed
This method is invoked when a callback is requested. The method raises
'OnCellSelected' event to fire up the event handlers. If you override this
method, be sure to call the parent implementation so that the event
handler can be invoked.
|
public
|
raiseCallbackEvent(TCallbackEventParameter $param) : mixed
Raises the callback event. This method is required by {@see \Prado\Web\UI\ActiveControls\ICallbackEventHandler}
interface. It will raise {@see onCellSelected OnCellSelected} event with a
{@see \Prado\Web\UI\ActiveControls\TActiveTableCellEventParameter} containing the zero-based index of the
TActiveTableCell.
This method is mainly used by framework and control developers. |
public
|
render(THtmlWriter $writer) : mixed
Renders and replaces the cell's content on the client-side. When render() is
called before the OnPreRender event, such as when render() is called during
a callback event handler, the rendering is defered until OnPreRender event
is raised.
|
protected
|
addAttributesToRender(THtmlWriter $writer) : mixed
Ensure that the ID attribute is rendered and registers the javascript code
for initializing the active control if the event handler for the
{@see onCellSelected OnCellSelected} event is set.
|
protected
|
|
protected
|
getPostBackOptions() : array<string|int, mixed>
Returns postback specifications for the table cell.
This method is used by framework and control developers. |