getCellPrototype() публичный Метод

Returns cell prototype ( html tag).
public getCellPrototype ( mixed $row = NULL ) : Nette\Utils\Html
$row mixed
Результат Nette\Utils\Html
Пример #1
0
 /**
  * @param \Grido\Components\Columns\Column $column
  * @param Callable $recordCallback
  * @return \Grido\Components\Columns\Column
  */
 public function setupAsMultirecord(\Grido\Components\Columns\Column $column, $recordCallback)
 {
     $column->getCellPrototype()->class[] = 'multirecord';
     $column->setCustomRender(function ($row) use($recordCallback) {
         $return = Html::el('ul', ['class' => 'select2-choices']);
         foreach ($recordCallback($row) as $item) {
             $li = Html::el('li', ['class' => 'select2-search-choice']);
             $li->create('div', $item);
             $return->add($li);
         }
         return $return;
     });
     return $column;
 }
Пример #2
0
 /**
  * Returns cell prototype (<td> html tag).
  * @param mixed $row
  * @return \Nette\Utils\Html
  */
 public function getCellPrototype($row = NULL)
 {
     $td = parent::getCellPrototype($row);
     if ($this->isEditable() && $row !== NULL) {
         if (!in_array('editable', $td->class)) {
             $td->class[] = 'editable';
         }
         $td->data['grido-editable-value'] = $this->editableValueCallback === NULL ? $this->getValue($row) : call_user_func_array($this->editableValueCallback, [$row, $this]);
     }
     return $td;
 }
Пример #3
0
 /**
  * Returns cell prototype (<td> html tag).
  * @param mixed $row
  * @return \Nette\Utils\Html
  */
 public function getCellPrototype($row = NULL)
 {
     $td = parent::getCellPrototype($row);
     if ($this->isEditable() && $row !== NULL) {
         $td->data['grido-editable-value'] = $this->editableValueCallback === NULL ? parent::getValue($row) : callback($this->editableValueCallback)->invokeArgs(array($row, $this));
     }
     return $td;
 }