private function draw_spacer($PFCALCULATOR, $title = "Graph") { $FirstRow = new TActiveTableRow(); $FirstRow->setID("R" . $this->sheetrow . "G"); //new for grouping $this->resulttable->Rows[] = $FirstRow; $ControlListCell = array(); //clean the children $ControlListCellChildren = array(); //clean the children $cell = new TActiveTableCell(); //id and button to expand and collapse $cell->setID("R" . $this->sheetrow . "C1G"); $imagebutton = new TActiveImageButton(); $imagebutton->setID("R" . $this->sheetrow . "C1GIB"); $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif"); $imagebutton->setText("collapse"); $imagebutton->onCallback = "page.hideRowGroup"; $imagebutton->setCommandParameter($this->sheetrow); $cell->Controls->add($imagebutton); $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => "R" . $this->sheetrow . "C1GIB", "OnCallback" => "page.hideRowGroup", "CommandParameter" => $this->sheetrow); //$cell->Text=$title; $activeLabel = new TActiveLabel(); $activeLabel->setID("R" . $this->sheetrow . "C1GAL"); $activeLabel->setText(" " . $title); $cell->Controls->add($activeLabel); $ControlListCellChildren[] = array("class" => "TActiveLabel", "id" => "R" . $this->sheetrow . "C1GAL", "OnCallback" => "", "CommandParameter" => ""); $cell->EnableViewState = true; $cell->setCssClass('listheader'); //echo (count($PFCALCULATOR->Perioden)*$PFCALCULATOR->NumberOfColumns)+1; $cell->setColumnSpan($PFCALCULATOR->NumberOfColumns + 1); $FirstRow->Cells[] = $cell; $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C1G", "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren); $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => "R" . $this->sheetrow . "G", "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell); $this->sheetrow++; //inccrement of the sheetrow }
public function createTable() { for ($ii = 1; $ii <= 10; $ii++) { $MyRow = new TActiveTableRow(); $ControlListCell = array(); //clean the children if ($ii % 3 == 0) { $rowId = "R" . $ii . "G"; } else { $rowId = "R" . $ii; } $MyRow->setID($rowId); $this->MyTable->Rows[] = $MyRow; for ($jj = 1; $jj <= 10; $jj++) { $cell = new TActiveTableCell(); $ControlListCellChildren = array(); //clean the children if ($jj % 3 == 0) { $cellID = "R" . $ii . "C" . $jj . "G"; } else { $cellID = "R" . $ii . "C" . $jj; } $cell->setID($cellID); //my imagebutton for test if ($jj == 1) { if ($ii % 3 == 0) { $imagebutton = new TActiveImageButton(); $imagebutton->setID($cellID . "IB"); $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif"); $imagebutton->setText("collapse"); $imagebutton->onCallback = "page.hideRowGroup"; $imagebutton->setCommandParameter($ii); $cell->Controls->add($imagebutton); $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => $cellID . "IB", "OnCallback" => "page.hideRowGroup", "CommandParameter" => $ii); } else { $cell->Text = $jj * $ii; } } else { if ($ii == 1) { if ($jj % 3 == 0) { $imagebutton = new TActiveImageButton(); $imagebutton->setID($cellID . "IB"); $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif"); $imagebutton->setText("collapse"); $imagebutton->onCallback = "page.hideColumnGroup"; $imagebutton->setCommandParameter($jj); $cell->Controls->add($imagebutton); $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => $cellID . "IB", "OnCallback" => "page.hideColumnGroup", "CommandParameter" => $jj); } else { $cell->Text = $jj * $ii; } } else { $cell->Text = $jj * $ii; } } //this must appear at the end $MyRow->Cells[] = $cell; $ControlListCell[] = array("class" => "TActiveTableCell", "id" => $cellID, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren); } $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => $rowId, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell); } }