CompleteLister::renderRows PHP Метод

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

Render lister rows.
public renderRows ( )
    public function renderRows()
    {
        $this->odd_even = null;
        $this->total_rows = 0;
        $this->template->del($this->container_tag);
        // render data rows
        $iter = $this->getIterator();
        foreach ($iter as $this->current_id => $this->current_row) {
            if ($this->current_row instanceof Model) {
                $this->current_row = (array) $this->current_row->get();
            } elseif (!is_array($this->current_row) && !$this->current_row instanceof ArrayAccess) {
                // Looks like we won't be abel to access current_row as array, so we will
                // copy it's value inside $this->current instead and produce an empty array
                // to be filled out by a custom iterators
                $this->current = $this->current_row;
                $this->current_row = get_object_vars($this->current);
            }
            $this->current_row_html = array();
            if (!empty($this->sep_html) && $this->total_rows) {
                $this->renderSeparator();
            }
            // calculate rows so far
            ++$this->total_rows;
            // if onRender totals enabled, then update totals
            if ($this->totals_type == 'onRender') {
                $this->updateTotals();
            }
            // render data row
            $this->renderDataRow();
        }
        // calculate grand totals if needed
        if ($this->totals_type == 'onRequest') {
            $this->updateGrandTotals();
        }
        // set total row count
        $this->totals['row_count'] = $this->total_rows;
        // render totals row
        $this->renderTotalsRow();
    }

Usage Example

Пример #1
0
 /**
  * Render grid rows
  *
  * Extends renderRows method of CompleteLister
  *
  * @return void
  */
 function renderRows()
 {
     // precache template chunks
     $this->precacheTemplate();
     // extend CompleteLister renderRows method
     parent::renderRows();
     // if we have at least one data row rendered, then remove not_found message
     if ($this->total_rows) {
         $this->template->del('not_found');
     } elseif ($this->no_records_message) {
         $this->template->tryDel('all_table');
         $this->template->set('not_found_message', $this->no_records_message);
     }
 }
All Usage Examples Of CompleteLister::renderRows