public function init() { parent::init(); $this->headerOptions['width'] = '120px'; $this->template = '{update} {delete}'; }
/** * @inheritdoc */ public function init() { parent::init(); if (!isset($this->header)) { $this->header = Yii::t('app', 'Disabled status'); } }
public function init() { if (!Yii::$app->getRequest()->getIsAjax()) { DropdownAsset::register($this->grid->getView()); } parent::init(); }
public function init() { parent::init(); if (!isset($this->headerOptions['width'])) { $this->headerOptions['width'] = $this->width; } $this->contentOptions = ['class' => 'da-icon-column', 'style' => 'width:' . $this->width . ';']; }
public function init() { $this->header = $this->header ?: Module::t('Actions'); $this->footer = $this->footer ?: Module::t('Actions'); $this->headerOptions = ArrayHelper::merge(['class' => 'text-align-center', 'width' => '100'], $this->headerOptions); $this->footerOptions = ArrayHelper::merge(['class' => 'text-align-center font-weight-bold th'], $this->footerOptions); $this->contentOptions = ArrayHelper::merge(['class' => 'text-align-center nowrap'], $this->contentOptions); parent::init(); }
public function init() { parent::init(); if (is_array($this->params)) { $this->params = '&' . http_build_query($this->params); } else { $this->params = '&' . http_build_query(['ref' => Yii::$app->getRequest()->get('id')]); } }
/** * @inheritdoc */ public function init() { parent::init(); $this->buttons['update'] = function ($url, $model) { return Html::a('<i class="fa fa-pencil"></i> Edit', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0', 'class' => 'btn btn-primary btn-xs']); }; $this->buttons['delete'] = function ($url, $model) { return Html::a('<i class="fa fa-trash-o"></i> Delete', $url, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0', 'class' => 'btn btn-primary btn-xs']); }; }
public function init() { parent::init(); $methods = get_class_methods($this); preg_match_all('/button(\\w+)/', join(" ", $methods), $m); foreach ($m[1] as $button) { $this->buttons[lcfirst($button)] = function ($url, $model, $key) use($button) { $result = call_user_func_array([$this, "button" . $button], [$url, $model, $key]); if ($result instanceof ButtonColumn) { return $result->asLink(); } else { return $result; } }; } }
/** * @inheritdoc */ public function init() { if (!is_array($this->permissions)) { throw new InvalidConfigException('$permissions has to be an array of allowed permissions for each button.'); } if (!empty($this->permissions)) { foreach ($this->permissions as $key => $allowedPermissions) { if (!$this->checkIfUserHas($allowedPermissions)) { $this->buttons[$key] = function ($url, $model, $key) { return; }; } } } parent::init(); $this->initDefaultButtons(); }
/** * @inheritdoc * * @throws \yii\base\InvalidConfigException on invalid right config */ public function init() { parent::init(); //copy template value to internal var if ($this->template instanceof \Closure) { $this->templateInternal = $this->template; } //iterate over rights foreach ($this->buttonRights as $name => $value) { if (!isset($this->buttons[$name])) { continue; } if (!$this->checkRight($name, $value)) { unset($this->buttons[$name]); } } }
public function init(){ $visibleColumn=$this->statusColumn; $this->buttons = [ 'update' => function($url,$model){ return $this->updateButton($url,$model); }, 'view' => function($url,$model){ return $this->viewButton($url,$model); }, 'delete' => function($url,$model) use ($visibleColumn){ return ($model->hasAttribute($visibleColumn) && $model->$visibleColumn) ? $this->deleteButton($url,$model) : ''; } ]; parent::init(); }
public function init() { parent::init(); if (!isset($this->buttonOptions['class'])) { $this->buttonOptions['class'] = ['btn', 'btn-default', 'btn-action']; } if (!isset($this->header)) { $url = $this->createUrl('create', null, null, null); $this->header = $this->createButton($url, 'Создать', ['btn-create']); } /** * @param Kurs $model * @return bool */ $this->visibleButtons['iup'] = function ($model) { return $model->tip === TipKursa::PP || $model->tip === TipKursa::PO; }; }
public function init() { $this->_isDropdown = ($this->grid->bootstrap && $this->dropdown); if (!isset($this->header)) { $this->header = Yii::t('kvgrid', 'Actions'); } $this->parseFormat(); $this->parseVisibility(); parent::init(); $this->initDefaultButtons(); $this->setPageRows(); }
/** * Initializes the action column and triggers rendering of default buttons. * See [[initDefaultButtons]] for details. */ public function init() { parent::init(); $this->initDefaultButtons(); }
public function init() { /** @noinspection PhpUndefinedFieldInspection */ $this->_isDropdown = $this->grid->bootstrap && $this->dropdown; if (!isset($this->header)) { $this->header = Yii::t('kvgrid', 'Actions'); } $this->parseFormat(); $this->parseVisibility(); parent::init(); $this->initDefaultButtons(); $this->setPageRows(); }
public function init() { parent::init(); //$this->headerOptions['width'] = '120px'; $this->contentOptions = ['class' => 'da-icon-column']; }
/** * @inheritdoc */ public function init() { parent::init(); $view = $this->grid->getView(); ActionColumnAsset::register($view); }
public function init() { parent::init(); $this->headerOptions['width'] = '120px'; }
/** * @inherit */ public function init() { parent::init(); }
/** * @inheritdoc */ public function init() { $this->template = '<div class="btn-group" role="group">' . $this->template . '</div>'; parent::init(); }