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


PHP CGridColumn::init方法代码示例

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


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

示例1: init

 /**
  * Initializes the column.
  */
 public function init()
 {
     parent::init();
     if ($this->dataField === null) {
         $this->sortable = false;
     }
 }
开发者ID:BGCX261,项目名称:zii-svn-to-git,代码行数:10,代码来源:CDataColumn.php

示例2: init

 /**
  * Initializes the column.
  */
 public function init()
 {
     parent::init();
     if ($this->name === null && $this->value === null) {
         throw new CException(Yii::t('zii', 'Either "name" or "value" must be specified for CEditableColumn.'));
     }
 }
开发者ID:sharmarakesh,项目名称:edusec-college-management-system,代码行数:10,代码来源:CEditableColumn.php

示例3: init

 public function init()
 {
     parent::init();
     if ($this->name === null) {
         throw new CException(Yii::t('zii', '"name" must be specified for SelectColumn.'));
     }
 }
开发者ID:DarkAiR,项目名称:test,代码行数:7,代码来源:SelectColumn.php

示例4: 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

示例5: init

 public function init()
 {
     parent::init();
     if ($this->pathPrefix === null) {
         $this->pathPrefix = Yii::app()->baseUrl . '/uploads/';
     }
     if ($this->name === null) {
         throw new CException(Yii::t('zii', 'Please specify a name for EImageColumn.'));
     }
 }
开发者ID:nomannoor,项目名称:social-property,代码行数:10,代码来源:EImageColumn_businessPages.php

示例6: init

 /**
  * @throws CException
  */
 public function init()
 {
     parent::init();
     if (empty($this->name)) {
         $this->sortable = false;
     }
     if (empty($this->onImageUrl)) {
         $this->onImageUrl = Yii::app()->request->baseUrl . '/core/images/admin/yes.png';
     }
     if (empty($this->offImageUrl)) {
         $this->offImageUrl = Yii::app()->request->baseUrl . '/core/images/admin/no.png';
     }
     if (empty($this->name) && empty($this->value)) {
         throw new CException('Either "name" or "value" must be specified for DToggleColumn.');
     }
     $this->registerClientScript();
 }
开发者ID:kuzmina-mariya,项目名称:gallery,代码行数:20,代码来源:DToggleColumn.php

示例7: init

    public function init()
    {
        parent::init();
        $cs = Yii::app()->getClientScript();
        $gridId = $this->grid->getId();
        $script = <<<SCRIPT
\t\tjQuery(document).on("click", ".{$this->_flagClass}", function(e){
\t\t\te.preventDefault();
\t\t\tvar link = this;
\t\t\t\$.ajax({
\t\t\t\tdataType: "json",
\t\t\t\tcache: false,
\t\t\t\turl: link.href,
\t\t\t\tsuccess: function(data){
\t\t\t\t\t\$('#{$gridId}').yiiGridView.update('{$gridId}');
\t\t\t\t}
\t\t\t});
\t\t});
SCRIPT;
        $cs->registerScript(__CLASS__ . $gridId . '#flag_link', $script);
    }
开发者ID:moohwaan,项目名称:yii-application-cookbook-2nd-edition-code,代码行数:21,代码来源:FlagColumn.php

示例8: init

 public function init()
 {
     parent::init();
     $cs = Yii::app()->getClientScript();
     $gridId = $this->grid->getId();
     /*
     $script = <<<SCRIPT
     jQuery(document).on("click", ".{$this->_flagClass}", function(e) {e.preventDefault();
         var link = this;
         $.ajax({
             dataType: "json",
             cache: false,
             url: link.href,
             success: function(data){
                 $('#$gridId').yiiGridView.update('$gridId');
             }
         });
     });
     SCRIPT;
     $cs-> registerScript(__CLASS__.$gridId.'#flag_link', $script);
     */
 }
开发者ID:mikefetick,项目名称:sakila,代码行数:22,代码来源:FlagColumn.php

示例9: init

    public function init()
    {
        parent::init();
        if ($this->icons) {
            $this->_assets = Yii::app()->assetManager->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets');
        }
        $cs = Yii::app()->getClientScript();
        $gridId = $this->grid->getId();
        $script = <<<SCRIPT
\t\tjQuery(".{$this->_flagClass}").live("click", function(e){
\t\t\te.preventDefault();
\t\t\tvar link = this;
\t\t\t\$.ajax({
\t\t\t\tdataType: "json",
\t\t\t\tcache: false,
\t\t\t\turl: link.href,
\t\t\t\tsuccess: function(data){
\t\t\t\t\t\$('#{$gridId}').yiiGridView.update('{$gridId}');
\t\t\t\t}
\t\t\t});
\t\t});
SCRIPT;
        $cs->registerScript(__CLASS__ . $gridId . '#flag_link', $script);
    }
开发者ID:amlap,项目名称:Yii-Extensions,代码行数:24,代码来源:XFlagColumn.php

示例10: init

 public function init()
 {
     parent::init();
 }
开发者ID:rajveer4155,项目名称:vidmgr,代码行数:4,代码来源:indexColumn.php

示例11: 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

示例12: init

 /**
  * Init column
  * Publish necessary client script.
  */
 public function init()
 {
     parent::init();
     $this->publishReorderColumnAssets();
     $this->registerReorderColumnClientScript();
 }
开发者ID:rizaldi-github,项目名称:Yii-Playground,代码行数:10,代码来源:XReorderColumn.php


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