本文整理汇总了PHP中CGridView类的典型用法代码示例。如果您正苦于以下问题:PHP CGridView类的具体用法?PHP CGridView怎么用?PHP CGridView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGridView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: renderSummary
/**
* Renders the summary-clone changer. When the summary changes, it should update the summary-clone in the
* searchview if it is available. The ModalListView does not rely on this because it does not run
* jquery.globalEval on ajax changes such as pagination. It instead will call processListViewSummaryClone which
* is decleared @see ModalListView->getCGridViewAfterAjaxUpdate()
*
*/
public function renderSummary()
{
parent::renderSummary();
Yii::app()->clientScript->registerScript($this->id . '_listViewSummaryChangeScript', '
processListViewSummaryClone("' . $this->id . '", "' . $this->summaryCssClass . '", "' . $this->summaryCloneId . '");
');
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:14,代码来源:ExtendedGridView.php
示例3: renderTableBody
public function renderTableBody()
{
if (!empty($this->mergeColumns) || !empty($this->extraRowColumns)) {
$this->groupByColumns();
}
parent::renderTableBody();
}
开发者ID:hipogea,项目名称:zega,代码行数:7,代码来源:GroupGridView.php
示例4: 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
示例5: 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
示例6: 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
示例7: 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
示例8: 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
示例9: 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
示例10: 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
示例11: 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
示例12: 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
示例13: 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
示例14: 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
示例15: 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
示例16: 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
示例17: init
public function init()
{
parent::init();
$this->url = Yii::app()->getController()->createUrl('sort');
$this->model_name = get_class($this->filter);
$this->rowCssClassExpression = '"items[]_{$data->id}"';
$cond = '';
if (!empty($this->cond_attr)) {
$attr = $this->cond_attr;
$value = $this->filter->{$attr};
$cond = ",attr:'" . $attr . "',value:'" . $value . "'";
}
$str_js = "\n var fixHelper = function(e, ui) {\n ui.children().each(function() {\n \$(this).width(\$(this).width());\n });\n return ui;\n };\n\n \$('#" . $this->id . " table.items tbody').sortable({\n forcePlaceholderSize: true,\n forceHelperSize: true,\n items: 'tr',\n update : function (event,ui) {\n\n var el_index = ui.item.index();\n var el_class = ui.item.attr('class');\n var tmp = el_class.split('_');\n var el_id = tmp[1];\n\n\n \$.ajax({\n 'url': '" . $this->url . "',\n 'type': 'post',\n 'data': {index:el_index,id:el_id,model:'" . $this->model_name . "'" . $cond . "},\n 'success': function(data){\n //alert(data);\n \$('#" . $this->id . " table.items tbody tr:even').css('background','#eee');\n \$('#" . $this->id . " table.items tbody tr:odd').css('background','#F8F8F8');\n },\n 'error': function(request, status, error){\n //alert('We are unable to set the sort order at this time. Please try again in a few minutes.');\n }\n });\n },\n helper: fixHelper\n }).disableSelection();\n\n \$('#" . $this->id . " table.items tbody tr:even').css('background','#eee');\n \$('#" . $this->id . " table.items tbody tr:odd').css('background','#F8F8F8');\n ";
Yii::app()->clientScript->registerScript('sortable-project', $str_js);
Yii::app()->clientScript->registerCoreScript('jquery.ui');
}
开发者ID:fobihz,项目名称:cndiesel,代码行数:16,代码来源:CSortableGridView.php
示例18: init
public function init()
{
if (!isset($this->title)) {
$this->title = Yii::app()->getController()->getPageTitle();
}
parent::init();
//Autoload fix
spl_autoload_unregister(array('YiiBase', 'autoload'));
Yii::import(self::$phpExcelPathAlias, true);
self::$objPHPExcel = new PHPExcel();
self::$activeSheet = self::$objPHPExcel->getActiveSheet();
spl_autoload_register(array('YiiBase', 'autoload'));
// Creating a workbook
$properties = self::$objPHPExcel->getProperties();
$properties->setTitle($this->title)->setCreator($this->creator)->setSubject($this->subject)->setDescription($this->description)->setCategory($this->category);
//$this->initColumns();
}
开发者ID:josterricardo,项目名称:proyecto-cirugia,代码行数:17,代码来源:EExcelView.php
示例19: initColumns
public function initColumns()
{
if ($this->sortable === true) {
$exists = false;
foreach ($this->columns as $column) {
if (isset($column['class']) && $column['class'] == 'SortableColumn') {
$exists = true;
}
}
if ($exists === false) {
array_push($this->columns, array('class' => 'SortableColumn'));
}
}
$this->_generateClipboardData();
$this->_removeData();
Yii::app()->clientScript->registerScript("sortable-clipboard", "\n \$('.sortable-clipboard-area').sortable({\n connectWith : '.sortable-items tbody'\n });\n ", CClientScript::POS_READY);
parent::initColumns();
}
开发者ID:jumper2012,项目名称:english_learning,代码行数:18,代码来源:SortableGridView.php
示例20: init
/**
* Redeclare initialization
*/
public function init()
{
parent::init();
if ($this->enablePageSizing) {
if ($pageSize = Yii::app()->request->getParam($this->id . '-page-size')) {
$this->pageSize = $pageSize;
Yii::app()->session[$this->id . '-page-size'] = $this->pageSize;
} elseif (isset(Yii::app()->session[$this->id . '-page-size'])) {
$this->pageSize = Yii::app()->session[$this->id . '-page-size'];
}
if ($this->dataProvider->getPagination() !== false) {
$this->dataProvider->getPagination()->setPageSize($this->pageSize);
} else {
$this->dataProvider->setPagination(array('class' => 'CPagination', 'pageSize' => $this->pageSize));
$this->enablePagination = true;
}
$this->dataProvider->getData(true);
}
}
开发者ID:rash012,项目名称:cms,代码行数:22,代码来源:ExtGridView.php
注:本文中的CGridView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论