当前位置: 首页>>代码示例>>PHP>>正文


PHP DataColumn::renderFilterCellContent方法代码示例

本文整理汇总了PHP中yii\grid\DataColumn::renderFilterCellContent方法的典型用法代码示例。如果您正苦于以下问题:PHP DataColumn::renderFilterCellContent方法的具体用法?PHP DataColumn::renderFilterCellContent怎么用?PHP DataColumn::renderFilterCellContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\grid\DataColumn的用法示例。


在下文中一共展示了DataColumn::renderFilterCellContent方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderFilterCellContent

 protected function renderFilterCellContent()
 {
     $gridId = $this->grid->getId();
     $dropdownId = $gridId . '-dropdown2-filter-' . $this->attribute;
     $form = $this->grid->getForm();
     $filterModel = $this->grid->filterModel;
     $filterFields = $this->grid->filterFields;
     if ($form && $filterModel && array_key_exists($this->attribute, $filterFields)) {
         $cellContent = $form->field($filterModel, $this->attribute, $filterFields[$this->attribute]) . Html::tag('div', ButtonGroup::widget(['buttons' => [Html::button('<span class="glyphicon glyphicon-search"></span> ' . Yii::t('mozayka', 'Apply'), ['class' => 'btn btn-primary btn-sm', 'onclick' => 'jQuery(document).dropdown2(\'hide\'); jQuery(\'#' . $gridId . '\').yiiGridView(\'applyFilter\');']), Html::button('<span class="glyphicon glyphicon-ban-circle"></span> ' . Yii::t('mozayka', 'Reset'), ['class' => 'btn btn-default btn-sm', 'onclick' => 'jQuery(\'#' . $dropdownId . '\').find(\'input[type="text"], input[type="hidden"], textarea, select\').val(\'\');'])], 'options' => ['class' => 'pull-right']]), ['class' => 'clearfix']);
     } else {
         $cellContent = parent::renderFilterCellContent();
     }
     // dropdown2-panel
     if ($cellContent && $cellContent != $this->grid->emptyCell) {
         $cellContent = Html::button('<span class="glyphicon glyphicon-filter"></span>', ['title' => Yii::t('mozayka', 'Filter'), 'class' => 'btn btn-default btn-xs', 'data-dropdown2' => '#' . $dropdownId]) . Html::tag('div', Html::tag('div', $cellContent, ['class' => 'dropdown2-panel']), ['id' => $dropdownId, 'class' => 'dropdown2 dropdown2-tip' . (array_search($this, $this->grid->columns) + 1 > count($this->grid->columns) / 2 ? ' dropdown2-anchor-right' : '')]);
     }
     return $cellContent;
 }
开发者ID:ivan-chkv,项目名称:yii2-mozayka,代码行数:18,代码来源:DataColumn.php

示例2: renderFilterCellContent

 /**
  * Renders the filter cell content.
  * The default implementation simply renders a space.
  * This method may be overridden to customize the rendering of the filter cell (if any).
  * @return string the rendering result
  */
 protected function renderFilterCellContent()
 {
     if (is_string($this->filter)) {
         return $this->filter;
     }
     $model = $this->grid->filterModel;
     if ($this->filter !== false && $this->attribute !== null && $model->isAttributeActive($this->attribute)) {
         if ($model->hasErrors($this->attribute)) {
             Html::addCssClass($this->filterOptions, 'has-error');
             $error = ' ' . Html::error($model, $this->attribute, $this->grid->filterErrorOptions);
         } else {
             $error = '';
         }
         $filterOptions = ['=' => '=', '>' => '>', '<' => '<'];
         Html::addCssClass($this->filterInputOptions, 'date-filter-input');
         $dropDown = Html::activeDropDownList($model, $this->attribute . '_operand', $filterOptions, ['class' => 'form-control pull-left', 'style' => 'width: 32px; appearance: none; -moz-appearance: none; -webkit-appearance: none;']);
         $field = DatePicker::widget(['model' => $model, 'attribute' => $this->attribute, 'options' => $this->filterInputOptions, 'dateFormat' => 'yyyy-MM-dd']);
         return $dropDown . $field . $error;
     } else {
         return parent::renderFilterCellContent();
     }
 }
开发者ID:yeesoft,项目名称:yii2-yee-core,代码行数:28,代码来源:DateFilterColumn.php

示例3: renderFilterCellContent

 protected function renderFilterCellContent()
 {
     if (is_string($this->filter)) {
         return $this->filter;
     }
     $model = $this->grid->filterModel;
     if ($this->filter !== false && $this->attribute !== null && $model->isAttributeActive($this->attribute)) {
         if ($model->hasErrors($this->attribute)) {
             Html::addCssClass($this->filterOptions, 'error-state');
             $error = Html::error($model, $this->attribute, $this->grid->filterErrorOptions);
         } else {
             $error = '';
         }
         if (is_array($this->filter)) {
             $options = array_merge(['prompt' => ''], $this->filterInputOptions);
             return Html::beginTag('div', ['class' => 'input-control select']) . Html::activeDropDownList($model, $this->attribute, $this->filter, $options) . ' ' . $error . Html::endTag('div');
         } else {
             return Html::beginTag('div', ['class' => 'input-control text']) . Html::activeTextInput($model, $this->attribute, $this->filterInputOptions) . ' ' . $error . Html::endTag('div');
         }
     } else {
         return parent::renderFilterCellContent();
     }
 }
开发者ID:creators,项目名称:yii2-metroui,代码行数:23,代码来源:DataColumn.php

示例4: renderFilterCellContent

 /**
  * Renders filter inputs based on the `filterType`
  *
  * @return string
  */
 protected function renderFilterCellContent()
 {
     $content = parent::renderFilterCellContent();
     $chkType = !empty($this->filterType) && $this->filterType !== GridView::FILTER_CHECKBOX && $this->filterType !== GridView::FILTER_RADIO && !class_exists($this->filterType);
     if ($this->filter === false || empty($this->filterType) || $content === $this->grid->emptyCell || $chkType) {
         return $content;
     }
     $widgetClass = $this->filterType;
     $options = ['model' => $this->grid->filterModel, 'attribute' => $this->attribute, 'options' => $this->filterInputOptions];
     if (is_array($this->filter)) {
         if ($this->filterType === GridView::FILTER_SELECT2 || $this->filterType === GridView::FILTER_TYPEAHEAD) {
             $options['data'] = $this->filter;
         }
         if ($this->filterType === GridView::FILTER_RADIO) {
             return Html::activeRadioList($this->grid->filterModel, $this->attribute, $this->filter, $this->filterInputOptions);
         }
     }
     if ($this->filterType === GridView::FILTER_CHECKBOX) {
         return Html::activeCheckbox($this->grid->filterModel, $this->attribute, $this->filterInputOptions);
     }
     $options = ArrayHelper::merge($this->filterWidgetOptions, $options);
     /** @var \kartik\base\Widget $widgetClass */
     return $widgetClass::widget($options);
 }
开发者ID:georgepoulos,项目名称:DiavgeiaInsights,代码行数:29,代码来源:DataColumn.php

示例5: renderFilterCellContent

 /**
  * @inheritdoc
  */
 protected function renderFilterCellContent()
 {
     if (is_string($this->filter)) {
         return $this->filter;
     }
     //generates input following dbType
     $input = $this->getFilterInputByType();
     if ($input !== null) {
         return $input . $this->getFilterError();
     }
     //default
     return parent::renderFilterCellContent();
 }
开发者ID:bruno-melo,项目名称:components,代码行数:16,代码来源:DataColumn.php

示例6: renderFilterCellContent

 protected function renderFilterCellContent()
 {
     return parent::renderFilterCellContent();
 }
开发者ID:rocketyang,项目名称:dcms2,代码行数:4,代码来源:ToggleColumn.php

示例7: renderFilterCellContent

 /**
  * Renders the filter cell content.
  * The default implementation simply renders a space.
  * This method may be overridden to customize the rendering of the filter cell (if any).
  * @return string the rendering result
  */
 protected function renderFilterCellContent()
 {
     if (is_string($this->filter)) {
         return $this->filter;
     }
     $model = $this->grid->filterModel;
     if ($this->filter !== false && $model instanceof Model && $this->attribute !== null && $model->isAttributeActive($this->attribute)) {
         if ($model->hasErrors($this->attribute)) {
             Html::addCssClass($this->filterOptions, 'has-error');
             $error = ' ' . Html::error($model, $this->attribute, $this->grid->filterErrorOptions);
         } else {
             $error = '';
         }
         return Html::activeTextInput($model, $this->attribute, $this->filterInputOptions) . $error;
     } else {
         return parent::renderFilterCellContent();
     }
 }
开发者ID:yeesoft,项目名称:yii2-yee-core,代码行数:24,代码来源:TitleActionColumn.php

示例8: renderFilterCellContent

 /**
  * @inheritdoc
  */
 protected function renderFilterCellContent()
 {
     if (is_string($this->filter)) {
         return $this->filter;
     }
     $model = $this->grid->filterModel;
     if ($this->filter !== false && $model instanceof Model && $this->attribute !== null && $model->isAttributeActive($this->attribute)) {
         if ($model->hasErrors($this->attribute)) {
             Html::addCssClass($this->filterOptions, 'has-error');
             $error = ' ' . Html::error($model, $this->attribute, $this->grid->filterErrorOptions);
         } else {
             $error = '';
         }
         if (is_array($this->filter)) {
             $filterItems = $this->filter;
             $filterItems[$this->filterAllValue] = Yii::t('yii2tech-admin', 'All records');
         } else {
             $filterItems = ['0' => Yii::t('yii2tech-admin', 'Deleted'), $this->filterAllValue => Yii::t('yii2tech-admin', 'All records')];
         }
         $options = array_merge(['prompt' => Yii::t('yii2tech-admin', 'Actual only')], $this->filterInputOptions);
         return Html::activeDropDownList($model, $this->attribute, $filterItems, $options) . $error;
     } else {
         return parent::renderFilterCellContent();
     }
 }
开发者ID:ASP96,项目名称:admin,代码行数:28,代码来源:DeleteStatusColumn.php

示例9: renderFilterCellContent

 protected function renderFilterCellContent()
 {
     if (is_string($this->filter)) {
         return $this->filter;
     }
     $model = $this->grid->filterModel;
     if ($this->filter !== false && $model instanceof Model && $this->attribute !== null && $model->isAttributeActive($this->attribute)) {
         if ($model->hasErrors($this->attribute)) {
             $error = Html::error($model, $this->attribute, $this->grid->filterErrorOptions);
         } else {
             $error = '';
         }
         if (is_array($this->filter)) {
             $options = array_merge(['prompt' => ''], $this->filterDropdownOptions);
             if ($model->hasErrors($this->attribute)) {
                 Html::addCssClass($options, 'error');
             }
             return Select::widget(['model' => $model, 'attribute' => $this->attribute, 'items' => $this->filter, 'options' => $options, 'search' => true]) . ' ' . $error;
         } else {
             $options = ['class' => 'fluid'];
             if ($model->hasErrors($this->attribute)) {
                 Html::addCssClass($options, 'error');
             }
             return Elements::input(Html::activeTextInput($model, $this->attribute, $this->filterInputOptions) . $error, $options);
         }
     } else {
         return parent::renderFilterCellContent();
     }
 }
开发者ID:hscstudio,项目名称:psiaga,代码行数:29,代码来源:DataColumn.php

示例10: renderFilterCellContent

 /**
  * @inheritdoc
  */
 protected function renderFilterCellContent()
 {
     if ($this->format == 'boolean') {
         $this->filter = [\Yii::t('app', 'No'), \Yii::t('app', 'Yes')];
     }
     if (is_string($this->filter)) {
         return $this->filter;
     }
     $model = $this->grid->filterModel;
     if ($this->filter !== false && $model instanceof Model && $this->attribute !== null && $model->isAttributeActive($this->attribute)) {
         if ($model->hasErrors($this->attribute)) {
             Html::addCssClass($this->filterOptions, 'has-error');
             $error = ' ' . Html::error($model, $this->attribute, $this->grid->filterErrorOptions);
         } else {
             $error = '';
         }
         if (is_array($this->filter)) {
             $options = array_merge(['prompt' => ''], $this->filterInputOptions);
             return Html::activeDropDownList($model, $this->attribute, $this->filter, $options) . $error;
         } else {
             return Html::activeTextInput($model, $this->attribute, $this->filterInputOptions) . $error;
         }
     } else {
         return parent::renderFilterCellContent();
     }
 }
开发者ID:tolik505,项目名称:bl,代码行数:29,代码来源:ModifiedDataColumn.php


注:本文中的yii\grid\DataColumn::renderFilterCellContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。