/** * Render row item detail button * @param Row $row * @return Html */ public function renderButton($row) { $a = Html::el('a')->href($this->grid->link('getItemDetail!', ['id' => $row->getId()]))->data('toggle-detail', $row->getId())->data('toggle-detail-grid', $this->grid->getName()); $this->tryAddIcon($a, $this->getIcon(), $this->getText()); $a->addText($this->text); if ($this->title) { $a->title($this->grid->getTranslator()->translate($this->title)); } if ($this->class) { $a->class($this->class); } return $a; }
/** * Render row item detail button * @param Row $row * @return Html */ public function renderButton($row) { $a = Html::el('a')->href($this->grid->link('getItemDetail!', ['id' => $row->getId()]))->data('toggle-detail', $row->getId())->data('toggle-detail-grid', $this->grid->getName()); if ($this->icon) { $a->add(Html::el('span')->class(DataGrid::$icon_prefix . $this->icon)); if (strlen($this->text)) { $a->add(' '); } } $a->add($this->text); if ($this->title) { $a->title($this->title); } if ($this->class) { $a->class($this->class); } return $a; }
/** * Render row item detail button * @param Row $row * @return Html */ public function renderButton($row) { $a = Html::el('a')->href($this->grid->link('inlineEdit!', ['id' => $row->getId()])); $this->tryAddIcon($a, $this->getIcon(), $this->getText()); $a->add($this->text); if ($this->title) { $a->title($this->title); } if ($this->class) { $a->class($this->class); } return $a; }
/** * Render row item detail button * @param Row $row * @return Html */ public function renderButton($row) { $a = Html::el('a')->href($this->grid->link('inlineEdit!', ['id' => $row->getId()])); $this->tryAddIcon($a, $this->getIcon(), $this->getText()); $a->addText($this->text); if ($this->title) { $a->title($this->grid->getTranslator()->translate($this->title)); } if ($this->class) { $a->class[] = $this->class; } $a->class[] = 'datagrid-inline-edit-trigger'; return $a; }
/** * Render item detail button * @param mixed $item * @return Html */ public function renderButton($item) { if (is_object($item)) { $id_value = $item->{$this->grid->getPrimaryKey()}; } else { $id_value = $item[$this->grid->getPrimaryKey()]; } $a = Html::el('a')->href($this->grid->link('getItemDetail!', ['id' => $id_value]))->data('toggle-detail', $id_value)->data('toggle-detail-grid', $this->grid->getName()); if ($this->icon) { $a->add(Html::el('span')->class(DataGrid::$icon_prefix . $this->icon)); if (strlen($this->text)) { $a->add(' '); } } $a->add($this->text); if ($this->title) { $a->title($this->title); } if ($this->class) { $a->class($this->class); } return $a; }