Exemple #1
0
 /**
  * Renders the data items for the grid view.
  */
 public function renderItems()
 {
     if ($this->extended && $this->filter) {
         $this->insertDropdownHtml();
         $this->insertModelAttributes();
     }
     parent::renderItems();
     if ($this->enableCustomActions === true) {
         $this->widget('zii.widgets.CMenu', array('id' => $this->getId() . 'Actions', 'htmlOptions' => array('class' => 'gridFooterActions'), 'items' => $this->getCustomActions()));
     }
 }
    /**
     * Renders the data items for the grid views.
     */
    public function renderItems() {

        if(Yii::app()->user->hasFlash('CQTeeGridView')) {
            print '<div style="background-color:#ffeeee;padding:7px;border:2px solid #cc0000;">'. Yii::app()->user->getFlash("CQTeeGridView") . '</div>';
        }
        parent::renderItems();
    }
Exemple #3
0
 /**
  * Renders the data items for the grid view.
  */
 public function renderItems()
 {
     if ($this->enableHeader) {
         //$this->enableHeader
         $params = array();
         if (isset($this->name)) {
             $params['title'] = $this->name;
         }
         if ($this->headerOptions && $this->autoColumns) {
             $params['options'] = array(array('label' => self::t('CHANGE_TABLE'), 'icon' => 'icon-table-2', 'href' => 'javascript:grid.editcolums("' . $this->id . '","' . $this->dataProvider->modelClass . '","' . $this->controller->module->id . '");'));
         }
         if (isset($this->headerButtons)) {
             $params['buttons'] = $this->headerButtons;
         }
         Yii::app()->tpl->openWidget($params);
     }
     echo Html::openTag('div', array('class' => 'table-responsive'));
     parent::renderItems();
     echo Html::closeTag('div');
     if ($this->selectableRows > 0 && $this->enableCustomActions === true && count($this->dataProvider->getData()) > 0) {
         //echo '<select class="CA" name="test" onChange="customActions(this);">';
         if ($this->enableCustomActions === true) {
             $this->widget('zii.widgets.CMenu', array('id' => $this->getId() . 'Actions', 'encodeLabel' => false, 'submenuHtmlOptions' => array('class' => 'dropdown-menu'), 'htmlOptions' => array('class' => 'btn-group dropup gridActions'), 'items' => array(array('label' => 'Выбрать действие <span class="caret"></span>', 'url' => '#', 'linkOptions' => array('class' => 'btn btn-sm btn-default', 'data-toggle' => 'dropdown', 'aria-haspopup' => "true", 'aria-expanded' => "false"), 'items' => $this->getCustomActions()))));
         }
     }
     $this->renderPager();
     if ($this->enableHeader) {
         //$this->autoColumns &&
         Yii::app()->tpl->closeWidget();
     }
 }
 /**
  *
  */
 public function renderItems()
 {
     if ($this->export) {
         $export = array();
         foreach ($this->columns as $column) {
             /** @var $column CDataColumn */
             $export['headers'][] = $column->header ? $column->header : $column->name;
         }
         $data = $this->dataProvider->getData();
         foreach ($data as $row => $line) {
             foreach ($this->columns as $column) {
                 $export[$row][] = '"' . str_replace('"', '""', $column->renderDataCell($row)) . '"';
             }
         }
         echo implode(",", $export['headers']) . "\n";
         unset($export['headers']);
         foreach ($export as $key => $value) {
             echo implode(",", $value) . "\n";
         }
     } else {
         parent::renderItems();
     }
 }