Beispiel #1
0
 /**
  * This method will be called when the component (or component's parent)
  * becomes attached to a monitored object. Do not call this method yourself.
  * @param  IComponent
  * @return void
  */
 protected function attached($dataGrid)
 {
     if ($dataGrid instanceof DataGrid) {
         $dataSource = clone $dataGrid->dataSource;
         $dataSource->orderBy(array());
         $this->min = (int) $dataSource->select($this->getName())->orderBy($this->getName(), 'ASC')->fetchSingle();
         $this->max = (int) $dataSource->select($this->getName())->orderBy($this->getName(), 'DESC')->fetchSingle();
     }
     parent::attached($dataGrid);
 }
Beispiel #2
0
 public function formatValue($row)
 {
     $value = parent::formatValue($row);
     if ($this->currencyPosition === self::POSITION_BEFORE) {
         $value = sprintf('%s%s%s', $this->currencySymbol, $this->currencySeparator, $value);
     } else {
         $value = sprintf('%s%s%s', $value, $this->currencySeparator, $this->currencySymbol);
     }
     return trim($value);
 }
Beispiel #3
0
 /**
  * Checkbox column constructor
  *
  * @param string $caption column's textual caption
  */
 public function __construct($caption = NULL)
 {
     parent::__construct($caption, 0);
     $this->getCellPrototype()->style('text-align: center');
 }