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


PHP CDataColumn::init方法代码示例

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


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

示例1: init

 public function init()
 {
     parent::init();
     $this->addPocketData();
     $this->removeFromData();
     $this->grid->onRegisterScript = array($this, 'registerScript');
 }
开发者ID:nizsheanez,项目名称:alp.ru,代码行数:7,代码来源:ManyManySortableColumn.php

示例2: init

    /**
     * Initializes the column.
     *
     * @see CDataColumn::init()
     */
    public function init()
    {
        parent::init();
        if (!isset($this->htmlCheckBoxOptions['class'])) {
            $this->htmlCheckBoxOptions['class'] = 'checkBoxColumn-' . $this->id;
        }
        $cs = Yii::app()->getClientScript();
        $gridId = $this->grid->getId();
        $script = '
        jQuery(".' . $this->htmlCheckBoxOptions['class'] . '").live("click", function(e){

          $.ajax({
            type: "POST",
            dataType: "json",
            cache: false,
            url: "' . (is_array($this->actionUrl) ? CHtml::normalizeUrl($this->actionUrl) : $this->actionUrl) . '",
            data: {
                
                attr: "' . $this->name . '",
                model: "' . get_class($this->grid->filter) . '",
                item: $(this).attr("itemid"),
                checked: $(this).attr("checked")?1:0
            },
            success: function(data){
              //alert();
              $("#' . $gridId . '").yiiGridView.update("' . $gridId . '");
            }
          });
        });';
        $cs->registerScript(__CLASS__ . $gridId . '#active_column-' . $this->id, $script);
    }
开发者ID:fobihz,项目名称:cndiesel,代码行数:36,代码来源:phaCheckColumn.php

示例3: init

 /**
  * Initializes the column.
  *
  * @see CDataColumn::init()
  */
 public function init()
 {
     parent::init();
     if (!isset($this->selectBoxHtmlOptions['class'])) {
         $this->selectBoxHtmlOptions['class'] = 'selectColumn-' . $this->id;
     }
     $cs = Yii::app()->getClientScript();
     $gridId = $this->grid->getId();
     $script = '
     jQuery(".' . $this->selectBoxHtmlOptions['class'] . '").live("change", function(e){
       e.preventDefault();
       $.ajax({
         type: "POST",
         dataType: "json",
         cache: false,
         url: "' . (is_array($this->actionUrl) ? CHtml::normalizeUrl($this->actionUrl) : $this->actionUrl) . '",
         data: {
             item: $(this).attr("itemId"),
             value:$("option:selected",this).val()
         },
         success: function(data){
           $("#' . $gridId . '").yiiGridView.update("' . $gridId . '");
         }
       });
     });';
     $cs->registerScript(__CLASS__ . $gridId . '#active_column-' . $this->id, $script);
 }
开发者ID:fobihz,项目名称:cndiesel,代码行数:32,代码来源:phaSelectColumn.php

示例4: init

 public function init()
 {
     parent::init();
     $this->assets = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias($this->assets)) . '/publishedColumn';
     $this->initVariables();
     $this->grid->onRegisterScript = array($this, 'registerScript');
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:7,代码来源:PublishedColumn.php

示例5: 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:snapfrozen,项目名称:boxomatic,代码行数:10,代码来源:CEditableColumn.php

示例6: renderHeaderCellContent

	protected function renderHeaderCellContent()
	{
		$this->registerScripts();
		if ($this->headerText != null)
			echo $this->headerText;
		else 
			parent::init();
	}
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:8,代码来源:AjaxDataColumn.php

示例7: init

 public function init()
 {
     if ($this->url == null) {
         $this->url = '/' . preg_replace('#' . Yii::app()->controller->action->id . '$#', 'sortable', Yii::app()->controller->route);
     }
     $this->registerScripts();
     parent::init();
 }
开发者ID:jumper2012,项目名称:english_learning,代码行数:8,代码来源:SortableColumn.php

示例8: init

 /**
  * Initialises the column.
  * Sets the initial value for the total.
  */
 public function init()
 {
     parent::init();
     if (is_string($this->init)) {
         $this->init = $this->evaluateExpression($this->init);
     }
     $this->_total = $this->init;
     $this->_sortDesc = !empty($this->sort) && $this->grid->dataProvider->getSort()->getDirection($this->sort);
 }
开发者ID:bylinggha,项目名称:Capella-ERP-Indonesia,代码行数:13,代码来源:RunningTotalColumn.php

示例9: init

 public function init()
 {
     if (!$this->name) {
         throw new CException('You should provide name for EditableColumn');
     }
     parent::init();
     //need to attach ajaxUpdate handler to refresh editables on pagination and sort
     WhEditable::attachAjaxUpdateEvent($this->grid);
 }
开发者ID:branJakJak,项目名称:goawtodayaldiskon,代码行数:9,代码来源:WhEditableColumn.php

示例10: init

 /**
  * Initializes the column.
  */
 public function init()
 {
     if (isset($this->headerHtmlOptions['class'])) {
         $this->headerHtmlOptions['class'] .= ' header';
     } else {
         $this->headerHtmlOptions['class'] = 'header';
     }
     parent::init();
 }
开发者ID:vangogogo,项目名称:justsns,代码行数:12,代码来源:BootDataColumn.php

示例11: init

	public function init()
	{
	    parent::init();
	    
		if ($this->onButtonImageUrl === null)
			$this->onButtonImageUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.widgets.assets.gridview').'/check_icon.png');
		if ($this->offButtonImageUrl === null)
			$this->offButtonImageUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.widgets.assets.gridview').'/uncheck_icon.png');
			
		$this->registerClientScript();
	}
开发者ID:Kostiantin,项目名称:floors,代码行数:11,代码来源:OnOffColumn.php

示例12: init

 public function init()
 {
     // allows width to be set for column using width property
     if ($this->width) {
         $this->headerHtmlOptions['style'] = isset($this->headerHtmlOptions['style']) ? $this->headerHtmlOptions['style'] : '';
         $this->htmlOptions['style'] = isset($this->htmlOptions['style']) ? $this->htmlOptions['style'] : '';
         $this->headerHtmlOptions['style'] .= 'width: ' . $this->width . ';';
         $this->htmlOptions['style'] .= 'width: ' . $this->width . ';';
     }
     return parent::init();
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:11,代码来源:X2DataColumnGeneric.php

示例13: init

 public function init()
 {
     if (!$this->grid->dataProvider instanceof CActiveDataProvider) {
         throw new CException(Yii::t('zii', 'TbEditableColumn can be applied only to grid based on CActiveDataProvider'));
     }
     if (!$this->name) {
         throw new CException(Yii::t('zii', 'You should provide name for TbEditableColumn'));
     }
     parent::init();
     if ($this->isEditable($this->grid->dataProvider->model)) {
         $this->attachAjaxUpdateEvent();
     }
 }
开发者ID:janym,项目名称:angular-yii,代码行数:13,代码来源:TbEditableColumn.php

示例14: init

 public function init()
 {
     if (!$this->grid->dataProvider instanceof CActiveDataProvider) {
         throw new CException('EditableColumn can be applied only to grid based on CActiveDataProvider');
     }
     if (!$this->name) {
         throw new CException('You should provide name for EditableColumn');
     }
     parent::init();
     //need to attach ajaxUpdate handler to refresh editables on pagination and sort
     //should be here, before render of grid js
     $this->attachAjaxUpdateEvent();
 }
开发者ID:asdmundt,项目名称:templateYiiApp,代码行数:13,代码来源:EditableColumn.php

示例15: init

 public function init()
 {
     parent::init();
     //$this->visible = false;//didnt work
     //$this->header = '';
     //if($this->name=='active'||$this->name=='created_on'||$this->name=='created_by'){
     if ($this->name == 'created_on' || $this->name == 'created_by') {
         $this->htmlOptions = array('class' => 'debug');
         $this->headerHtmlOptions = array('class' => 'debug');
         $this->footerHtmlOptions = array('class' => 'debug');
         $this->filterHtmlOptions = array('class' => 'debug');
     }
 }
开发者ID:sjnlabs2013,项目名称:sampleyii,代码行数:13,代码来源:JDataColumn.php


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