RenderTop
function Render(GridRow $row)
Rendering template html.
Show/Hide Code
<?php
...
class MyEditTemplate implements GridTemplate
{
function Render($_row)
{
$html = "<input id='city_input' name='city_input' type='text' />"; Input for user
$html .= "<input type='button' value='Confirm' onclick='grid_confirm_edit(this)'/>"; //Render confirm button.
$html .= "<input type='button' value='Cancel' onclick='grid_cancel_edit(this)'/>"; //Render cancel button.
return $html;
}
function GetData($_row)
{
return array("city"=>$_POST["city_input"]);
}
}
...
$grid->MasterTable->EditSettings->Mode = "Template";
$grid->MasterTable->EditSettings->Template = new MyEditTemplate();
...
?>
Supported from version: 1.5.4.0
GetDataTop
function GetData(GridRow $row)
Getting data from template. The return of the function must be an associate arrays containing new data.
Show/Hide Code
<?php
...
class MyEditTemplate implements GridTemplate
{
function Render($_row)
{
$html = "<input id='city_input' name='city_input' type='text' />"; Input for user
$html .= "<input type='button' value='Confirm' onclick='grid_confirm_edit(this)'/>"; //Render confirm button.
$html .= "<input type='button' value='Cancel' onclick='grid_cancel_edit(this)'/>"; //Render cancel button.
return $html;
}
function GetData($_row)
{
return array("city"=>$_POST["city_input"]);
}
}
...
$grid->MasterTable->EditSettings->Mode = "Template";
$grid->MasterTable->EditSettings->Template = new MyEditTemplate();
...
?>
Supported from version: 1.5.4.0