當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CGridColumn類代碼示例

本文整理匯總了PHP中CGridColumn的典型用法代碼示例。如果您正苦於以下問題:PHP CGridColumn類的具體用法?PHP CGridColumn怎麽用?PHP CGridColumn使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CGridColumn類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: renderDataCell

 /**
  * A seam for people extending CGridView to be able to hook onto the data cell rendering process.
  * 
  * By overriding only this method we will not need to copypaste and modify the whole entirety of `renderTableRow`.
  * Or override `renderDataCell()` method of all possible CGridColumn descendants.
  * 
  * @param CGridColumn $column The Column instance to 
  * @param integer $row
  * @since 1.1.17
  */
 protected function renderDataCell($column, $row)
 {
     $column->renderDataCell($row);
 }
開發者ID:tranthanhtuan269,項目名稱:crm,代碼行數:14,代碼來源:CGridView.php

示例2: getRenderedDataCellValue

 /**
  * @param CGridColumn $column
  * @param integer $row
  *
  * @return string
  */
 private function getRenderedDataCellValue($column, $row)
 {
     ob_start();
     $column->renderDataCell($row);
     return ob_get_clean();
 }
開發者ID:zhaoyan158567,項目名稱:YiiBooster,代碼行數:12,代碼來源:TbExtendedGridView.php

示例3: renderHeaderCellContent

 protected function renderHeaderCellContent()
 {
     CGridColumn::renderHeaderCellContent();
 }
開發者ID:sundgaarden,項目名稱:dashboard,代碼行數:4,代碼來源:ACheckBoxColumn.php

示例4: renderFooterCell

 /**
  *  Override to handle spanning of row.  Used primarily by matrix reports to render a grid
  */
 public function renderFooterCell()
 {
     if (isset($this->footer)) {
         return parent::renderFooterCell();
     }
     return null;
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:10,代碼來源:YAxisHeaderColumn.php

示例5: renderHeaderCellContent

 /**
  * Renders the header cell content.
  * This method will render a link that can trigger the sorting if the column is sortable.
  */
 protected function renderHeaderCellContent()
 {
     if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
         echo $this->grid->dataProvider->getSort()->link($this->name, $this->header);
     } else {
         parent::renderHeaderCellContent();
     }
 }
開發者ID:BGCX261,項目名稱:zii-svn-to-git,代碼行數:12,代碼來源:CDataColumn.php

示例6: getDataCellContent

 public function getDataCellContent($row)
 {
     if (method_exists(get_parent_class($this), 'getDataCellContent')) {
         return parent::getDataCellContent($row);
     }
     ob_start();
     $this->renderDataCellContent($row, $this->grid->dataProvider->data[$row]);
     return ob_get_clean();
 }
開發者ID:nineinchnick,項目名稱:edatatables,代碼行數:9,代碼來源:EGridColumn.php

示例7: init

 public function init()
 {
     parent::init();
     $data = $this->grid->dataProvider->getData();
     if (count($data) == 0) {
         return;
     }
     $this->link = ObjectUrlRule::createUrlFromCurrent(BackendModule::ROUTE_INSTANCE_LIST, array(ObjectUrlRule::PARAM_OBJECT_PARENT => '{id}'), array(ObjectUrlRule::PARAM_SYSTEM_MODULE, ObjectUrlRule::PARAM_PAGER_NUM, ObjectUrlRule::PARAM_OBJECT_INSTANCE, ObjectUrlRule::PARAM_ACTION_VIEW));
     $this->countData = $this->grid->dataProvider->model->getCountChildOfInstances($data);
 }
開發者ID:kot-ezhva,項目名稱:ygin,代碼行數:10,代碼來源:FolderColumn.php

示例8: renderHeaderCellContent

 /**
  * Renders the header cell content.
  * This method will render a link that can trigger the sorting if the column is sortable.
  */
 protected function renderHeaderCellContent()
 {
     if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
         echo $this->grid->dataProvider->getSort()->link($this->name, $this->header, array('class' => 'sort-link'));
     } elseif ($this->name !== null && $this->header === null) {
         if ($this->grid->dataProvider instanceof CActiveDataProvider) {
             echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
         } else {
             echo CHtml::encode($this->name);
         }
     } else {
         parent::renderHeaderCellContent();
     }
 }
開發者ID:DarkAiR,項目名稱:test,代碼行數:18,代碼來源:SelectColumn.php

示例9: renderHeaderCellContent

 /**
  * Renders the header cell content.
  * This method will render a checkbox in the header when {@link CGridView::selectableRows} is greater than 1.
  */
 protected function renderHeaderCellContent()
 {
     if ($this->grid->selectableRows > 1) {
         echo CHtml::checkBox($this->id . '_all', false);
     } else {
         parent::renderHeaderCellContent();
     }
 }
開發者ID:BGCX261,項目名稱:zii-svn-to-git,代碼行數:12,代碼來源:CCheckBoxColumn.php

示例10: init

 public function init()
 {
     parent::init();
 }
開發者ID:rajveer4155,項目名稱:vidmgr,代碼行數:4,代碼來源:indexColumn.php

示例11: renderFilterCellContent

 /**
  * Renders the filter cell content.
  * This method will render the {@link filter} as is if it is a string.
  * If {@link filter} is an array, it is assumed to be a list of options, and a dropdown selector will be rendered.
  * Otherwise if {@link filter} is not false, a text field is rendered.
  * @since 1.1.1
  */
 protected function renderFilterCellContent()
 {
     if ($this->filter !== null) {
         if (is_string($this->filter)) {
             echo $this->filter;
         } else {
             if ($this->filter !== false && $this->grid->filter !== null && $this->name !== null && strpos($this->name, '.') === false) {
                 if (is_array($this->filter)) {
                     echo CHtml::activeDropDownList($this->grid->filter, $this->name, $this->filter, array('id' => false, 'prompt' => ''));
                 } else {
                     if ($this->filter === null) {
                         echo CHtml::activeTextField($this->grid->filter, $this->name, array('id' => false));
                     }
                 }
             } else {
                 parent::renderFilterCellContent();
             }
         }
     }
 }
開發者ID:rfjaimes,項目名稱:awegen,代碼行數:27,代碼來源:JToggleColumn.php

示例12: renderHeaderCellContent

 /**
  * Render header cell (can not be sortable)
  */
 protected function renderHeaderCellContent()
 {
     if ($this->name !== null && $this->header === null) {
         if ($this->grid->dataProvider instanceof CActiveDataProvider) {
             echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
         } else {
             echo CHtml::encode($this->name);
         }
     } else {
         parent::renderHeaderCellContent();
     }
 }
開發者ID:rizaldi-github,項目名稱:Yii-Playground,代碼行數:15,代碼來源:XReorderColumn.php

示例13: init

    public function init()
    {
        parent::init();
        $arrayOfId = $this->grid->dataProvider->getKeys();
        if (count($arrayOfId) == 0) {
            return;
        }
        $availableObjects = array();
        $singleStatus = 0;
        foreach ($this->childData as $param) {
            if ($param->isRelation() == false) {
                continue;
            }
            $idObject = $param->getIdObjectParameter();
            // Смотрим, может ли пользователь работать с подчинённым объектом
            if (isset($availableObjects[$idObject]) && $availableObjects[$idObject] === null) {
                continue;
            }
            if (!Yii::app()->authManager->checkObject(DaDbAuthManager::OPERATION_LIST, Yii::app()->user->id, $idObject)) {
                $availableObjects[$idObject] = null;
                continue;
            } else {
                $singleStatus = $singleStatus == 0 ? 1 : 2;
                $availableObjects[$idObject][$param->getIdParameter()]['field'] = $param->getFieldName();
            }
        }
        if ($singleStatus == 2) {
            $this->single = false;
            $this->htmlOptions = array('class' => 'col-ref action-sub-data');
        } else {
            $this->htmlOptions = array('class' => 'col-ref-one action-sub-data');
        }
        foreach ($availableObjects as $idObject => $params) {
            if ($params === null) {
                unset($availableObjects[$idObject]);
                continue;
            }
            $object = null;
            if (count($params) == 1) {
                $object = DaObject::getById($idObject, false);
                foreach ($params as $idParameter => $caption) {
                    $availableObjects[$idObject][$idParameter]['caption'] = $object->name;
                }
            } else {
                $object = DaObject::getById($idObject, true);
                foreach ($params as $idParameter => $caption) {
                    $param = $object->getParameterObjectByIdParameter($idParameter);
                    $availableObjects[$idObject][$idParameter]['caption'] = $object->name . ' (' . $param->caption . ')';
                }
            }
            $model = $object->getModel();
            foreach ($params as $idParameter => $config) {
                $cr = new CDbCriteria();
                $cr->addColumnCondition(array('t.id_object' => $idObject));
                $cr->order = 't.order_no';
                $objectView = DaObjectView::model()->find($cr);
                $dataProvider = Yii::app()->controller->buildDataProvider($objectView, $model);
                $where = $dataProvider->criteria->condition;
                $params = $dataProvider->criteria->params;
                $whereConfig = array('and');
                if ($where != null) {
                    $whereConfig[] = $where;
                }
                $whereConfig[] = array('in', $config['field'], $arrayOfId);
                $data = Yii::app()->db->createCommand()->select($config['field'] . ' AS id, count(*) AS cnt')->from($model->tableName())->where($whereConfig, $params)->group($config['field'])->queryAll();
                /*
                        // многообъектая поддержка
                        $iq = new InstanceQuery($where);
                        $arrayOfIdObject = Object::getCommonObjectBySingle($idObjectTmp);
                        if (count($arrayOfIdObject) > 1) {
                          $iq->setUsedObjects(array($idObjectTmp));
                        }*/
                $assocData = array();
                foreach ($data as $row) {
                    $assocData[$row['id']] = $row['cnt'];
                }
                $availableObjects[$idObject][$idParameter]['data'] = $assocData;
            }
        }
        $this->prepareData = $availableObjects;
        // TODO: Поменять скрипт, когда будет применяться PopOver
        if (!$this->single) {
            Yii::app()->clientScript->registerScript('admin.subData.init', '$(".action-sub-data").daSubData();
$(document).on("afterGridUpdate", function(e) {  $(".action-sub-data").daSubData(); });
', CClientScript::POS_READY);
            /*
                    Yii::app()->clientScript->registerScript('admin.subData.init', '
                    $("[rel=\'popover-sub-data\']").popover({
                      placement: "left",
                      trigger:   "hover",
                      template:  "<div class=\'popover\'><div class=\'arrow\'></div><div class=\'popover-inner\'><div class=\'popover-content\'></div></div></div>"
                    });', CClientScript::POS_READY);
            */
        }
    }
開發者ID:Cranky4,項目名稱:npfs,代碼行數:95,代碼來源:RelationsColumn.php

示例14: renderHeaderCellContent

 /**
  * Renders the header cell content.
  * This method will render a checkbox in the header when {@link selectableRows} is greater than 1
  * or in case {@link selectableRows} is null when {@link CGridView::selectableRows} is greater than 1.
  */
 protected function renderHeaderCellContent()
 {
     if (trim($this->headerTemplate) === '') {
         echo $this->grid->blankDisplay;
         return;
     }
     $item = '';
     if ($this->selectableRows === null && $this->grid->selectableRows > 1) {
         $item = CHtml::checkBox($this->id . '_all', false, array('class' => 'select-on-check-all'));
     } elseif ($this->selectableRows > 1) {
         $item = CHtml::checkBox($this->id . '_all', false);
     } else {
         ob_start();
         parent::renderHeaderCellContent();
         $item = ob_get_clean();
     }
     echo strtr($this->headerTemplate, array('{item}' => $item));
 }
開發者ID:lucifurious,項目名稱:yii,代碼行數:23,代碼來源:CCheckBoxColumn.php

示例15: getHeaderCellContent

 /**
  * Returns the header cell content.
  * This method will render a checkbox in the header when {@link selectableRows} is greater than 1
  * or in case {@link selectableRows} is null when {@link CGridView::selectableRows} is greater than 1.
  * @return string the header cell content.
  * @since 1.1.16
  */
 public function getHeaderCellContent()
 {
     if (trim($this->headerTemplate) === '') {
         return $this->grid->blankDisplay;
     }
     if ($this->selectableRows === null && $this->grid->selectableRows > 1) {
         $item = CHtml::checkBox($this->id . '_all', false, array('class' => 'select-on-check-all'));
     } elseif ($this->selectableRows > 1) {
         $item = CHtml::checkBox($this->id . '_all', false);
     } else {
         $item = parent::getHeaderCellContent();
     }
     return strtr($this->headerTemplate, array('{item}' => $item));
 }
開發者ID:omonra,項目名稱:blog,代碼行數:21,代碼來源:CCheckBoxColumn.php


注:本文中的CGridColumn類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。