• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CDataColumn类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

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


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


示例3: parseColumnValue

 /**
  *### .parseColumnValue()
  *
  * @param CDataColumn $column
  * @param integer $row the current row number
  *
  * @return string
  */
 protected function parseColumnValue($column, $row)
 {
     ob_start();
     $column->renderDataCell($row);
     $value = ob_get_clean();
     if ($column instanceof CDataColumn && array_key_exists($column->name, $this->extendedSummary['columns'])) {
         // lets get the configuration
         $config = $this->extendedSummary['columns'][$column->name];
         // add the required column object in
         $config['column'] = $column;
         // build the summary operation object
         $op = $this->getSummaryOperationInstance($column->name, $config);
         // process the value
         $op->processValue($value);
     }
     return $value;
 }
开发者ID:yinhe,项目名称:yincart,代码行数:25,代码来源:TbExtendedGridView.php


示例4: renderDataCellContent

 protected function renderDataCellContent($row, $data)
 {
     if (!$this->isEditable($data)) {
         parent::renderDataCellContent($row, $data);
         return;
     }
     $options = CMap::mergeArray($this->editable, array('model' => $data, 'attribute' => $this->name));
     //if value defined for column --> use it as element text
     if (strlen($this->value)) {
         ob_start();
         parent::renderDataCellContent($row, $data);
         $text = ob_get_clean();
         $options['text'] = $text;
         $options['encode'] = false;
     }
     $editable = $this->grid->controller->createWidget('TbEditableField', $options);
     //manually make selector non unique to match all cells in column
     $selector = get_class($editable->model) . '_' . $editable->attribute;
     $editable->htmlOptions['rel'] = $selector;
     $editable->renderLink();
     //manually render client script (one for all cells in column)
     if (!$this->isScriptRendered) {
         $script = $editable->registerClientScript();
         Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $selector . '-event', '
             $("#' . $this->grid->id . '").parent().on("ajaxUpdate.yiiGridView", "#' . $this->grid->id . '", function() {' . $script . '});
         ');
         $this->isScriptRendered = true;
     }
 }
开发者ID:janym,项目名称:angular-yii,代码行数:29,代码来源:TbEditableColumn.php


示例5: renderFilterCellContent

 /**
  * Renders the filter cell content. Here we can provide HTML options for actual filter input
  */
 protected function renderFilterCellContent()
 {
     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 ($this->filterInputOptions) {
                 $filterInputOptions = $this->filterInputOptions;
                 if (empty($filterInputOptions['id'])) {
                     $filterInputOptions['id'] = false;
                 }
             } else {
                 $filterInputOptions = array();
             }
             if (is_array($this->filter)) {
                 $filterInputOptions['prompt'] = '';
                 echo CHtml::activeDropDownList($this->grid->filter, $this->name, $this->filter, $filterInputOptions);
             } else {
                 if ($this->filter === null) {
                     echo CHtml::activeTextField($this->grid->filter, $this->name, $filterInputOptions);
                 }
             }
         } else {
             parent::renderFilterCellContent();
         }
     }
 }
开发者ID:jackycgq,项目名称:advanced,代码行数:30,代码来源:TbDataColumn.php


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


示例7: renderHeaderCellContent

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


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


示例9: renderDataCell

 public function renderDataCell($row)
 {
     $this->checkCondition($row);
     //		if (!$this->_conditionResult || $this->isSpan)
     //		{
     parent::renderDataCell($row);
     //		}
 }
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:8,代码来源:SpanColumn.php


示例10: renderHeaderCellContent

 protected function renderHeaderCellContent()
 {
     if ($this->headerText != null) {
         echo $this->headerText;
     } else {
         parent::renderHeaderCellContent();
     }
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:8,代码来源:SortableColumn.php


示例11: renderDataCellContent

 protected function renderDataCellContent($row, $data)
 {
     if (!$this->visible) {
         return $this->grid->nullDisplay;
     } else {
         return parent::renderDataCellContent($row, $data);
     }
 }
开发者ID:frankpaul142,项目名称:nissan-modulos,代码行数:8,代码来源:EDataColumn.php


示例12: 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,代码来源:EDataColumn.php


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


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


示例15: renderHeaderCell

 /**
  * Renders the header cell.
  */
 public function renderHeaderCell()
 {
     if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
         $direction = $this->grid->dataProvider->sort->getDirection($this->name);
         if ($direction !== null) {
             $sortCssClass = $direction ? 'headerSortDown' : 'headerSortUp';
             $this->headerHtmlOptions['class'] .= ' ' . $sortCssClass;
         }
     }
     parent::renderHeaderCell();
 }
开发者ID:vangogogo,项目名称:justsns,代码行数:14,代码来源:BootDataColumn.php


示例16: 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->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:wpp8909,项目名称:findzhibo,代码行数:16,代码来源:TbDataColumn.php


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


示例18: getFilterCellContent

 public function getFilterCellContent()
 {
     if (is_string($this->filter)) {
         return $this->filter;
     } elseif ($this->filter !== false && $this->grid->filter !== null && $this->name !== null && strpos($this->name, '.') === false) {
         if (is_array($this->filter)) {
             return CHtml::activeDropDownList($this->grid->filter, $this->name, $this->filter, array('id' => false, 'prompt' => '', 'class' => 'form-control'));
         } elseif ($this->filter === null) {
             return CHtml::activeTextField($this->grid->filter, $this->name, array('id' => false, 'class' => 'form-control'));
         }
     } else {
         return parent::getFilterCellContent();
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:14,代码来源:DataColumn.php


示例19: renderHeaderCellContent

 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:ArseniyDyupin,项目名称:SimpleCRM2,代码行数:14,代码来源:MyCDataColumn.php


示例20: renderFilterCellContent

 protected function renderFilterCellContent()
 {
     if (is_string($this->filter)) {
         echo $this->filter;
     } elseif ($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' => ''));
         } elseif ($this->filter === null) {
             echo CHtml::activeTextField($this->grid->filter, $this->name, array('id' => false, 'accesskey' => $this->accesskey));
         }
         // 'placeholder' => '[Alt]+['.$this->accesskey.']'));
     } else {
         parent::renderFilterCellContent();
     }
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:15,代码来源:BDataColumn.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CDataXML类代码示例发布时间:2022-05-23
下一篇:
PHP CDOMElement类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap