initColumns() protected method

Creates column objects and initializes them.
protected initColumns ( )
示例#1
0
 /**
  * @inheritdoc
  */
 protected function initColumns()
 {
     foreach ($this->_template as $column) {
         if ($column != 'action') {
             $this->setupDataColumn($column);
         }
         if ($column == 'action') {
             $this->setupActionColumn();
         }
     }
     parent::initColumns();
 }
示例#2
0
 protected function initColumns()
 {
     parent::initColumns();
     if ($this->runInConsoleMode) {
         array_map(function ($column) {
             /** @var DataColumn $column */
             $column->enableSorting = false;
         }, $this->columns);
     }
 }