getCellPrototype() public méthode

Returns cell prototype ( html tag).
public getCellPrototype ( mixed $row = NULL ) : Nette\Utils\Html
$row mixed
Résultat Nette\Utils\Html
 /**
  * @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;
 }
Exemple #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;
 }
Exemple #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;
 }