public function renderTableBody()
 {
     if (!empty($this->mergeColumns) || !empty($this->extraRowColumns)) {
         $this->groupByColumns();
     }
     parent::renderTableBody();
 }
 /**
  * Registers necessary client scripts. 
  * Automaticlly prepend user's beforeajaxUpdate with needed code that will modify GET params when navigating and sorting
  */
 public function registerClientScript()
 {
     parent::registerClientScript();
     if ($this->selectableRows > 0) {
         $id = $this->getId();
         $options = array('selVar' => $this->selVar);
         $options = CJavaScript::encode($options);
         $cs = Yii::app()->getClientScript();
         $cs->registerScriptFile($this->selBaseScriptUrl . '/jquery.selgridview.js', CClientScript::POS_END);
         $cs->registerScript(__CLASS__ . '#' . $id . '-sel', "jQuery('#{$id}').selGridView({$options});");
     }
 }
Example #3
0
    public function initColumns()
    {
        $this->dataProvider->model->onBeforeGridInitColumns(new CModelEvent($this));

        if ($this->mass_removal)
        {
            $this->addColumn(array(
                                  'class'               => 'CCheckBoxColumn',
                                  'header'              => "<input type='checkbox' class='object_checkboxes'>",
                                  'selectableRows'      => 2,
                                  'checkBoxHtmlOptions' => array(
                                      'class'    => 'object_checkbox'
                                  )
                             ));
        }

        parent::initColumns();
        $this->dataProvider->model->onAfterGridInitColumns(new CModelEvent($this));
    }
Example #4
0
 /**
  * Renders the data items for the grid view.
  */
 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();
 }
Example #5
0
    /**
     * Изначально регистрируются 2 плагина gridBase и grid
     * Если установить значение свойства jsPlugin, то подключится так же плагин /css/admin/gridview/grid.js
     * И на сам grid будет инициализироват плагин с названием из jsPlugin
     */
    public function registerClientScript()
    {
        parent::registerClientScript();
        $cs = Yii::app()->clientScript;
        $cs->registerCoreScript('jquery.ui');
        $cs->registerScriptFile("/js/plugins/gridview/gridBase.js");
        $cs->registerScriptFile("/js/plugins/gridview/grid.js");

        $options = CJavaScript::encode(array(
            'mass_removal' => $this->mass_removal,
            'filter_hint'  => $this->filter_hint
        ));
        $cs->registerScript($this->getId() . '.grid', "
            $('#{$this->getId()}').grid({$options});
        ");

        $this->onRegisterScript(new CEvent);
    }