addColumn('no', 'no'); $this->addColumn('text', 'title', ['orderBy' => 'title']); $this->addColumn('text', 'certificateTitle', ['title' => 'Certificate', 'orderBy' => 'certificateTitle']); $this->addColumn( 'range', 'points', [ 'title' => 'Points', 'params' => ['min' => 'minPoints', 'max' => 'maxPoints'], ] ); $this->addColumn( 'text', 'estimatedTime', [ 'title' => 'Estimated Time', 'orderBy' => 'estimatedTime', 'defaultText' => '-', ] ); $this->addColumn( 'count', 'slidesCount', [ 'title' => 'Slides', 'orderBy' => 'slidesCount', 'url' => SlideView::getPage('url') . '/{id}', 'itemName' => 'Slide', ] ); $this->addColumn('link_enum', 'enabled', ['title' => 'show', 'orderBy' => 'enabled']); $this->addColumn('options', 'options', [ 'actions' => [ 'view' => [ 'formattedLink' => Qs_SiteMap::findFirstLocal([], ['type' => 'Training\\'], [], 'url') . '/{id}' ], 'edit' => [], 'delete' => [], ], 'initCallback' => function (&$params, &$column, &$row) { if (empty($row['hasEnabledSlides'])) { unset($column['actions']['view']); } } ]); return parent::_initColumns(); } }