當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。