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


PHP CGridView类代码示例

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


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

示例1: getWidgetScript

 private function getWidgetScript($callback1, $callback2, $callback3, $callback4)
 {
     Yii::import('zii.widgets.grid.CGridView');
     Yii::app()->clientScript->scripts = array();
     ob_start();
     $widget = new CGridView(null);
     $widget->beforeAjaxUpdate = $callback1;
     $widget->afterAjaxUpdate = $callback2;
     $widget->ajaxUpdateError = $callback3;
     $widget->selectionChanged = $callback4;
     $widget->dataProvider = new CArrayDataProvider(array(1, 2, 3));
     $widget->init();
     $widget->registerClientScript();
     Yii::app()->clientScript->render($out);
     ob_end_clean();
     return $out;
 }
开发者ID:super-d2,项目名称:codeigniter_demo,代码行数:17,代码来源:CGridViewTest.php

示例2: renderTableBody

 public function renderTableBody()
 {
     if (!empty($this->mergeColumns) || !empty($this->extraRowColumns)) {
         $this->groupByColumns();
     }
     parent::renderTableBody();
 }
开发者ID:hipogea,项目名称:zega,代码行数:7,代码来源:GroupGridView.php

示例3: init

 /**
  * Init the widget
  */
 public function init()
 {
     parent::init();
     $classes = array('table');
     if ($this->bordered) {
         $classes[] = 'table-bordered';
     }
     if ($this->striped) {
         $classes[] = 'table-striped';
     }
     if ($this->condensed) {
         $classes[] = 'table-condensed';
     }
     EBootstrap::mergeClassString($this->itemsCssClass, $classes);
     EBootstrap::mergeClass($this->htmlOptions, array('bootstrap-grid-view'));
     switch ($this->pagerAlign) {
         case 'centered':
             EBootstrap::mergeClassString($this->pagerCssClass, array('pagination-centered'));
             break;
         case 'right':
             EBootstrap::mergeClassString($this->pagerCssClass, array('pagination-right'));
             break;
     }
     if ($this->cssFile === false) {
         $cssFile = dirname(__FILE__) . '/css/bootstrap.css';
         $this->cssFile = Yii::app()->getAssetManager()->publish($cssFile);
         Yii::app()->clientScript->registerCssFile($this->cssFile);
     }
 }
开发者ID:raphaelrocha,项目名称:mtcontrool_mtcontext,代码行数:32,代码来源:EBootstrapGridView.php

示例4: init

    public function init()
    {
        $this->displayVar = $this->getId() . 'display';
        $this->pageVar = $this->getId() . 'page';
        $this->sortVar = $this->getId() . 'sort';
        $this->enablePagination = true;
        $this->enableSorting = true;
        $this->dataProvider->getPagination()->setPageSize(Yii::app()->request->getParam($this->getId() . 'display') ? Yii::app()->request->getParam($this->getId() . 'display') : 50);
        $this->dataProvider->getPagination()->pageVar = $this->getId() . 'page';
        $display = Yii::app()->request->getParam($this->displayVar);
        $this->ajaxUpdate = false;
        $this->summaryText = '
				<ul>
					<li>' . Yii::t('menu', 'Всего') . ': {count}</li>
				</ul>';
        $data = $this->dataProvider;
        $pagerBlock = $data->getTotalItemCount() > 50 ? '<div class="pager-block">
				<div class="left">{summary}</div>
				<div class="right">{pager}</div>
	  		</div>' : null;
        $this->template = '<div class="table-block">{items}</div>' . $pagerBlock;
        $this->dataProvider->getSort()->sortVar = $this->sortVar;
        $this->pager = array('header' => '', 'cssFile' => '', 'class' => 'MyCLinkPager', 'pageVar' => $this->pageVar, 'displayVar' => $this->displayVar, 'prevPageLabel' => '', 'nextPageLabel' => '', 'maxButtonCount' => '5');
        parent::init();
    }
开发者ID:ArseniyDyupin,项目名称:SimpleCRM2,代码行数:25,代码来源:MyCGridView.php

示例5: initColumns

 /**
  * Creates column objects and initializes them.
  */
 protected function initColumns()
 {
     foreach ($this->columns as $i => $column) {
         if (is_array($column) && !isset($column['class'])) {
             $this->columns[$i]['class'] = '\\TbDataColumn';
         }
     }
     parent::initColumns();
 }
开发者ID:noonnightcoder,项目名称:bakou-pos-apsara,代码行数:12,代码来源:TbGridView.php

示例6: init

 public function init()
 {
     $this->pager = array('class' => 'itemPaginator');
     if (Yii::app()->theme->name == 'atlas') {
         $this->pager = array('class' => 'itemPaginatorAtlas', 'header' => '', 'selectedPageCssClass' => 'current', 'htmlOptions' => array('class' => ''));
         $this->pagerCssClass = 'pagination';
     }
     parent::init();
 }
开发者ID:barricade86,项目名称:raui,代码行数:9,代码来源:NoBootstrapGridView.php

示例7: init

 public function init()
 {
     $themeUrl = Yii::app()->theme->baseUrl;
     $this->cssFile = $themeUrl . '/css/grid.css';
     $this->template = '{items}' . "\n" . '{pager}' . "\n" . '{summary}';
     //$this->beforeAjaxUpdate = 'js:function(id, data){ alertify.log("loading grid data... please wait..."); }';
     //$this->afterAjaxUpdate = 'js:function(id,options){ alertify.log("grid data successfully loaded","success"); }';
     return parent::init();
 }
开发者ID:sjnlabs2013,项目名称:sampleyii,代码行数:9,代码来源:JGridView.php

示例8: initColumns

 /**
  * Creates column objects and initializes them.
  */
 protected function initColumns()
 {
     foreach ($this->columns as &$column) {
         if (!isset($column['class'])) {
             $column['class'] = 'BootDataColumn';
         }
     }
     parent::initColumns();
 }
开发者ID:vangogogo,项目名称:justsns,代码行数:12,代码来源:BootGridView.php

示例9: initColumns

 protected function initColumns()
 {
     parent::initColumns();
     if ($this->filter !== null and $this->filterCleanColumn) {
         //Adiciona coluna para limpar filtros
         $this->htmlOptions['class'] .= ' hasFilter';
         $this->addCleanFiltersColumn();
     }
 }
开发者ID:bruno-melo,项目名称:components,代码行数:9,代码来源:MyGrid.php

示例10: init

 /**
  * Initializes the view.
  */
 public function init()
 {
     if ($this->enablePagination === false) {
         $this->dataProvider->setPagination(false);
     }
     if ($this->enableAlphaPagination && $this->dataProvider->getAlphaPagination() === false) {
         $this->enableAlphaPagination = false;
     }
     parent::init();
 }
开发者ID:kot-ezhva,项目名称:ygin,代码行数:13,代码来源:ApGridView.php

示例11: renderItems

 /**
  * Renders the data items for the grid view.
  */
 public function renderItems()
 {
     if ($this->extended && $this->filter) {
         $this->insertDropdownHtml();
         $this->insertModelAttributes();
     }
     parent::renderItems();
     if ($this->enableCustomActions === true) {
         $this->widget('zii.widgets.CMenu', array('id' => $this->getId() . 'Actions', 'htmlOptions' => array('class' => 'gridFooterActions'), 'items' => $this->getCustomActions()));
     }
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:14,代码来源:SGridView.php

示例12: init

 public function init()
 {
     $this->cssFile = false;
     $this->rowCssClass = array('row1', 'row2');
     $this->pager = array('htmlOptions' => array('class' => 'ui-pagination'), 'cssFile' => false, 'header' => false);
     $this->pagerCssClass = 'option';
     $this->template = '<div class="table-options">{pager}{summary}<span class="clear"><!-- --></span></div><div class="table full-width">{items}</div><div class="table-options">{pager}{summary}<span class="clear"><!-- --></span></div>';
     $this->summaryCssClass = false;
     $this->summaryText = 'Результаты <strong class="results-start">{start}</strong>-<strong class="results-end">{end}</strong> из <strong class="results-total">{count}</strong>';
     parent::init();
 }
开发者ID:stormrage-project,项目名称:valkyrie-yii,代码行数:11,代码来源:WGridWow.php

示例13: registerClientScript

 /**
  * Registers necessary client scripts. 
  * Automaticlly prepend user's beforeajaxUpdate with needed code that will modify GET params when navigating and sorting
  */
 public function registerClientScript()
 {
     parent::registerClientScript();
     if ($this->selectableRows > 0) {
         $id = $this->getId();
         $options = array('selVar' => $this->selVar);
         $options = CJavaScript::encode($options);
         $cs = Yii::app()->getClientScript();
         $cs->registerScriptFile($this->selBaseScriptUrl . '/jquery.selgridview.js', CClientScript::POS_END);
         $cs->registerScript(__CLASS__ . '#' . $id . '-sel', "jQuery('#{$id}').selGridView({$options});");
     }
 }
开发者ID:nguyendvphp,项目名称:onlinetraining,代码行数:16,代码来源:SelGridView.php

示例14: registerClientScript

    /**
     * Registers necessary client scripts.
     */
    public function registerClientScript()
    {
        parent::registerClientScript();

        $cs=Yii::app()->getClientScript();
        $cs->registerScriptFile($this->baseJuiUrl.'/jquery.ui.core.min.js',CClientScript::POS_END);
        $cs->registerScriptFile($this->baseJuiUrl.'/jquery.ui.widget.min.js',CClientScript::POS_END);
        $cs->registerScriptFile($this->baseJuiUrl.'/jquery.ui.mouse.min.js',CClientScript::POS_END);
        $cs->registerScriptFile($this->baseJuiUrl.'/jquery.ui.droppable.min.js',CClientScript::POS_END);
        $cs->registerScriptFile($this->baseJuiUrl.'/jquery.ui.draggable.min.js',CClientScript::POS_END);
        
        $baseUrl = Y::curBaseUrl();
        
        $cs->registerScript('draganddrop', '
            $(document).ready(function()  {
               $("#'.$this->getId().' tbody tr").live("mouseenter", function() {
	              var $this = $(this);
	              if($this.is(":data(draggable)")) return;
				  $this.draggable({
	                  helper: "clone",
	                  opacity: .75,
	                  refreshPositions: true, // Performance?
	                  revert: "invalid",
	                  revertDuration: 300,
	                  scroll: true
	              });
	           });
               $("#'.$this->getId().' tbody tr").live("mouseenter", function() {
               		var $this = $(this);
               		if ($this.is(":data(droppable)")) return;
				    $(this).droppable({
	                    drop: function(e, ui) {
							$("#'.$this->getId().'").addClass("grid-views-loading");
	                    	$.get(
		                    	"'.$baseUrl.'/movePosition",
								{
		                    		pk : $(ui.draggable).attr("id"),
		                    		to : $(this).attr("id")
		                    	},
		                    	function() {
		                    		$.fn.yiiGridView.update("'.$this->getId().'");
		    					}
		                    );
	                    },
	  					hoverClass: "accept",
	               });
               });
            });
		');
    }
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:53,代码来源:CQGridView.php

示例15: init

 public function init()
 {
     $this->title = $this->title ? $this->title : Yii::app()->getController()->getPageTitle();
     parent::init();
     //Autoload fix
     spl_autoload_unregister(array('YiiBase', 'autoload'));
     Yii::import('application.extensions.phpexcel.Classes.PHPExcel', true);
     $this->objPHPExcel = new PHPExcel();
     spl_autoload_register(array('YiiBase', 'autoload'));
     // Creating a workbook
     $this->objPHPExcel->getProperties()->setCreator($this->creator);
     $this->objPHPExcel->getProperties()->setTitle($this->title);
     $this->objPHPExcel->getProperties()->setSubject($this->subject);
     $this->objPHPExcel->getProperties()->setDescription($this->description);
     $this->objPHPExcel->getProperties()->setCategory($this->category);
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:16,代码来源:EExcelView.php


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