Exemplo n.º 1
0
 function render()
 {
     if (!$this->source_set) {
         if (!$this->model->loaded()) {
             throw $this->exception('Specified model must be loaded');
         }
         $data = array();
         foreach ($this->model->elements as $key => $field) {
             if ($field instanceof Field) {
                 $data[] = array('id' => $key, 'name' => $field->caption(), 'value' => $field->get());
             }
         }
         parent::setSource($data);
     }
     return parent::render();
 }
Exemplo n.º 2
0
 function render()
 {
     if (!$this->source_set) {
         if (!$this->model->loaded()) {
             throw $this->exception('Specified model must be loaded');
         }
         $data = array();
         foreach ($this->model->getActualFields() as $key) {
             $field = $this->model->hasElement($key);
             if (!$field) {
                 continue;
             }
             if ($field instanceof Field || $field instanceof Field_Base) {
                 $data[] = array('id' => $key, 'name' => $field->caption(), 'value' => $field->get());
             }
         }
         parent::setSource($data);
     }
     return parent::render();
 }
Exemplo n.º 3
0
 function updateTotals()
 {
     parent::updateTotals();
     foreach ($this->current_row as $key => $val) {
         if (!empty($this->totals_title_field) and $key == $this->totals_title_field) {
             $this->totals[$key] = $this->totals_title;
         }
     }
 }
Exemplo n.º 4
0
 /**
  * Calculate grand totals of all rows
  *
  * Called one time on rendering phase - before renderRows() call.
  *
  * @return void
  */
 function updateGrandTotals()
 {
     parent::updateGrandTotals();
 }