Ejemplo n.º 1
0
 /**
  * Renders a row
  *
  * @param Tx_PtExtlist_Domain_Model_List_Row $row Row to be rendered
  * @param mixed $rowIndex Holds index of row in listData structure
  * @return Tx_PtExtlist_Domain_Model_List_Row Rendered row
  */
 public function renderRow(Tx_PtExtlist_Domain_Model_List_Row $row, $rowIndex)
 {
     $renderedRow = new Tx_PtExtlist_Domain_Model_List_Row();
     // copy special values
     $renderedRow->setSpecialValues($row->getSpecialValues());
     $columnCollection = $this->getColumnCollection();
     $columnIndex = 0;
     foreach ($columnCollection as $columnIdentifier => $column) {
         /* @var $column Tx_PtExtlist_Domain_Model_List_Header_HeaderColumn */
         $columnConfig = $column->getColumnConfig();
         // Only render if FE-User is allowed to see the column
         if ($columnConfig->isAccessable() && $column->getIsVisible()) {
             // Use strategy to render cells
             $cell = $this->renderCell($columnConfig, $row, $columnIndex, $rowIndex);
             $renderedRow->addCell($cell, $columnIdentifier);
         }
         $columnIndex++;
     }
     unset($row);
     return $renderedRow;
 }
Ejemplo n.º 2
0
 /**
  * @param array $rowData
  * @return Tx_PtExtlist_Domain_Model_List_Row
  */
 protected function createRowFromTestData(array $rowData)
 {
     $row = new Tx_PtExtlist_Domain_Model_List_Row();
     $row->setSpecialValues($rowData['specialValues']);
     foreach ($rowData['columns'] as $key => $testCell) {
         $cell = new Tx_PtExtlist_Domain_Model_List_Cell($testCell['value']);
         $cell->setCSSClass($testCell['cssClass']);
         $cell->setColumnIndex($testCell['columnIndex']);
         $cell->setRowIndex($testCell['rowIndex']);
         $cell->addSpecialValue('key1', $testCell['specialValues']['key1']);
         $row->addCell($cell, $key);
     }
     return $row;
 }