Prado\Web\UI\WebControls\TDataGrid::render PHP Метод

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

Renders the datagrid.
public render ( $writer )
    public function render($writer)
    {
        if ($this->getHasControls()) {
            $this->groupCells();
            if ($this->_useEmptyTemplate) {
                $control = new TWebControl();
                $control->setID($this->getClientID());
                $control->copyBaseAttributes($this);
                if ($this->getHasStyle()) {
                    $control->getStyle()->copyFrom($this->getStyle());
                }
                $control->renderBeginTag($writer);
                $this->renderContents($writer);
                $control->renderEndTag($writer);
            } else {
                if ($this->getViewState('ItemCount', 0) > 0) {
                    $this->applyItemStyles();
                    if ($this->_topPager) {
                        $this->_topPager->renderControl($writer);
                        $writer->writeLine();
                    }
                    $this->renderTable($writer);
                    if ($this->_bottomPager) {
                        $writer->writeLine();
                        $this->_bottomPager->renderControl($writer);
                    }
                }
            }
        }
    }

Usage Example

Пример #1
0
 /**
  * Renders the datagrid by writing a {@link getSurroundingTag()} with the container id obtained
  * from {@link getSurroundingTagId()} which will be called by the replacement method of the client
  * script to update it's content.
  * @param THtmlWriter writer for the rendering purpose
  */
 private function renderDataGrid($writer)
 {
     $writer->addAttribute('id', $this->getSurroundingTagID());
     $writer->renderBeginTag($this->getSurroundingTag());
     parent::render($writer);
     $writer->renderEndTag();
 }