/**
  * Show record detail
  */
 public function onShowDetail($param)
 {
     // get row position
     $pos = $this->datagrid->getRowIndex('code', $param['key']);
     // get row by position
     $current_row = $this->datagrid->getRow($pos);
     $current_row->style = "background-color: #8D8BC8; color:white; text-shadow:none";
     // create a new row
     $row = new TTableRow();
     $row->style = "background-color: #E0DEF8";
     $row->addCell('');
     $cell = $row->addCell('In this space, you can add any detail<br> content about the selected record');
     $cell->colspan = 4;
     $cell->style = 'padding:10px;';
     // insert the new row
     $this->datagrid->insert($pos + 1, $row);
 }
 public function addParsedObject($o)
 {
     if ($o instanceof TFilter) {
         $this->_filters[$o->getDataField()] = $o;
         $cell = new TTableCell();
         //$cell->setId('cell_'.$o->getId());
         $cell->getControls()->add($o);
         $this->getCells()->add($cell);
     } else {
         parent::addParsedObject($o);
     }
 }
Esempio n. 3
0
 /**
  * Renders and replaces the row'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.
  * @param THtmlWriter html writer
  */
 public function render($writer)
 {
     if ($this->getHasPreRendered()) {
         parent::render($writer);
         if ($this->getActiveControl()->canUpdateClientSide()) {
             $this->getPage()->getCallbackClient()->replaceContent($this, $writer);
         }
     } else {
         $this->getPage()->getAdapter()->registerControlToRender($this, $writer);
         // If we update a TActiveTableRow on callback, we shouldn't update all childs,
         // because the whole content will be replaced by the parent.
         if ($this->getHasControls()) {
             foreach ($this->findControlsByType('IActiveControl', false) as $control) {
                 $control->getActiveControl()->setEnableUpdate(false);
             }
         }
     }
 }
Esempio n. 4
0
 private function draw_cells($PFCALCULATOR, $name = "", $details = 1)
 {
     $PFCALCULATOR->executePIVOTSQL($name, $details);
     $PFCALCULATOR->FormatWerte();
     $ROWS = $PFCALCULATOR->getValues();
     $ALTERNATING = 0;
     $templabel = '';
     foreach ($ROWS as $row) {
         $ALTERNATING++;
         $temparray = array();
         $counter = 0;
         //hier bauen wir die einzelnen Zeilen
         $WorkRow = new TTableRow();
         $this->mastertable->Rows[] = $WorkRow;
         if ($ALTERNATING < count($ROWS)) {
             foreach ($row as $value) {
                 $cell = new TTableCell();
                 $cell->EnableViewState = false;
                 $cell->Text = $value;
                 $counter == 0 ? $templabel = $value : array_push($temparray, $value);
                 $counter++;
                 $WorkRow->Cells[] = $cell;
                 fmod($ALTERNATING, 2) == 0 ? $WorkRow->setCssClass('listalternating') : $WorkRow->setCssClass('listnonealternating');
             }
             $this->zwischenergebnisse[$PFCALCULATOR->dimension][$templabel] = $temparray;
         } else {
             foreach ($row as $value) {
                 $cell = new TTableCell();
                 $cell->EnableViewState = false;
                 $cell->Text = $value;
                 $counter == 0 ? $templabel = $value : array_push($temparray, $value);
                 $counter++;
                 $cell->setCssClass('calculatedsumme');
                 $WorkRow->Cells[] = $cell;
                 //$WorkRow->setCssClass('calculatedsumme');
             }
             //$this->zwischenergebnisse[$PFCALCULATOR->dimension][$templabel]=$temparray;
         }
     }
 }
 /**
  * Constructor.
  * Initializes the type to 'Item'.
  */
 public function __construct()
 {
     $this->type = self::TYPE_ITEM;
     parent::__construct();
 }
Esempio n. 6
0
 /**
  * Constructor.
  * @param integer zero-based index of the item in the item collection of datagrid
  * @param TListItemType item type
  */
 public function __construct($itemIndex, $dataSourceIndex, $itemType)
 {
     parent::__construct();
     $this->_itemIndex = $itemIndex;
     $this->_dataSourceIndex = $dataSourceIndex;
     $this->setItemType($itemType);
     if ($itemType === TListItemType::Header) {
         $this->setTableSection(TTableRowSection::Header);
     } else {
         if ($itemType === TListItemType::Footer) {
             $this->setTableSection(TTableRowSection::Footer);
         }
     }
 }