public function initializeCell($cell, $columnIndex, $itemType)
{
if ($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem) {
$button = $this->createButton('Edit', $this->getEditText(), false, '');
$cell->getControls()->add($button);
$cell->registerObject('EditButton', $button);
} else {
if ($itemType === TListItemType::EditItem) {
$controls = $cell->getControls();
$button = $this->createButton('Update', $this->getUpdateText(), $this->getCausesValidation(), $this->getValidationGroup());
$controls->add($button);
$cell->registerObject('UpdateButton', $button);
$controls->add(' ');
$button = $this->createButton('Cancel', $this->getCancelText(), false, '');
$controls->add($button);
$cell->registerObject('CancelButton', $button);
} else {
parent::initializeCell($cell, $columnIndex, $itemType);
}
}
}