Exemplo n.º 1
0
 public function getBodyAttributes($data)
 {
     $attributes = parent::getBodyAttributes($data);
     if (isset($this->grid['editable']) && $this->isEditable()) {
         $this->checkColumnId($data);
         $attributes = array_merge($attributes, array('data-editable' => $this->option[self::ID], 'data-editable-type' => 'text'));
     }
     $attributes['class'] = 'type-text';
     return parent::mergeAttributes($data, $attributes);
 }
Exemplo n.º 2
0
 public function getBodyAttributes($data)
 {
     if (isset($data[$this->option[self::ID]]) === FALSE && is_null($data[$this->option[self::ID]]) === FALSE) {
         throw new Grid_Exception('Column ' . $this->option[self::ID] . ' does not exists in DataSource.');
     }
     $attributes = parent::getBodyAttributes($data);
     if (isset($this->grid['editable']) && $this->isEditable()) {
         $attributes = array('data-editable' => $this->option[self::ID], 'data-editable-type' => 'number', 'data-separator' => $this->option[self::THOUSANDS_SEP], 'data-unit' => is_null($this->option[self::UNIT]) ? '' : $this->option[self::UNIT]);
     }
     $attributes['class'] = 'type-number';
     return parent::mergeAttributes($data, $attributes);
 }
Exemplo n.º 3
0
 public function getBodyAttributes($data)
 {
     if (isset($data[$this->option[self::ID]]) === FALSE && is_null($data[$this->option[self::ID]]) === FALSE) {
         throw new Grid_Exception('Column ' . $this->option[self::ID] . ' does not exists in DataSource.');
     }
     $attributes = parent::getBodyAttributes($data);
     if (isset($this->grid['editable']) && $this->isEditable()) {
         $attributes = array('data-editable' => $this->option[self::ID], 'data-editable-type' => 'date', 'data-date-format' => $this->formatToMomentJsFormat($this->option[self::FORMAT]));
     }
     $attributes['class'] = 'type-date';
     return parent::mergeAttributes($data, $attributes);
 }