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