Example #1
0
 /**
  * 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;
 }
Example #2
0
 /**
  * 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;
 }
Example #3
0
 /**
  * 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;
 }
Example #4
0
 /**
  * @param Row $newRow
  */
 function addRow(Row $newRow)
 {
     $rowId = $newRow->getId();
     $this->row[$rowId] = $newRow;
 }
Example #5
0
 /**
  * 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;
 }
Example #6
0
 public function testGetId()
 {
     $row = new Row('user', array('name' => 'testuser'), $this->phactory);
     $row->save();
     $this->assertEquals($row->getId(), $row->id);
 }