예제 #1
0
파일: GridView.php 프로젝트: snivs/semanti
 /**
  * Initializes the grid view.
  * This method will initialize required property values and instantiate [[columns]] objects.
  */
 public function init()
 {
     $this->dataColumnClass = DataColumn::className();
     $this->summaryOptions = ['class' => 'summary well well-sm pull-left margin-bottom-10px'];
     $this->layout = '{summary}<div class="clearfix"></div>{pager}{items}{pager}';
     $this->showFooter = true;
     $this->options = ArrayHelper::merge($this->options, ['class' => 'grid-view table-responsive']);
     $this->pager = ['class' => LinkPager::className()];
     parent::init();
 }
예제 #2
0
 /**
  * We should use this when we add a new row, because that new row created like other rows
  */
 protected function initOtherRowColumns()
 {
     if (!empty($this->otherRowColumns)) {
         foreach ($this->otherRowColumns as $i => $column) {
             if (is_string($column)) {
                 $column = $this->createDataColumn($column);
             } else {
                 $column = Yii::createObject(array_merge(['class' => $this->dataColumnClass ?: DataColumn::className(), 'grid' => $this], $column));
             }
             if (!$column->visible) {
                 unset($this->otherRowColumns[$i]);
                 continue;
             }
             $this->otherRowColumns[$i] = $column;
         }
     }
 }