Beispiel #1
0
 /**
  * @param mixin $row
  * @param \Latte\Runtime\CachingIterator $iterator
  * @return mixin
  */
 public function getRowIdentifier($row, \Latte\Runtime\CachingIterator $iterator)
 {
     if ($this->rowIdentifierCallback === NULL) {
         return $iterator->key();
     }
     return Callback::invokeArgs($this->rowIdentifierCallback, array($row));
 }
 /**
  * Rewinds the Iterator.
  * @return void
  */
 public function rewind()
 {
     parent::rewind();
     $this->counter = parent::valid() ? 1 : 0;
 }
Beispiel #3
0
 /**
  * @param \Lohini\Components\DataGrid\DataGrid $dataGrid
  * @return string
  */
 public function renderLoadMore(\Lohini\Components\DataGrid\DataGrid $dataGrid)
 {
     if ($this->dataGrid !== $dataGrid) {
         $this->dataGrid = $dataGrid;
     }
     $paginator = $this->dataGrid->paginator;
     if ($paginator->itemCount) {
         $rows = $this->dataGrid->getRows();
         $iterator = new CachingIterator($rows);
         $container = Html::el();
         foreach ($iterator as $data) {
             $row = $this->generateContentRow($data);
             if (!($paginator->itemsPerPage * $paginator->page % 2) && $iterator->isEven()) {
                 $row->addClass($this->getValue('row.content .even'));
             }
             $container->add($row);
         }
         return $container->render();
     }
     return '';
 }