本文整理汇总了PHP中CGridColumn类的典型用法代码示例。如果您正苦于以下问题:PHP CGridColumn类的具体用法?PHP CGridColumn怎么用?PHP CGridColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGridColumn类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: renderDataCell
/**
* A seam for people extending CGridView to be able to hook onto the data cell rendering process.
*
* By overriding only this method we will not need to copypaste and modify the whole entirety of `renderTableRow`.
* Or override `renderDataCell()` method of all possible CGridColumn descendants.
*
* @param CGridColumn $column The Column instance to
* @param integer $row
* @since 1.1.17
*/
protected function renderDataCell($column, $row)
{
$column->renderDataCell($row);
}
开发者ID:tranthanhtuan269,项目名称:crm,代码行数:14,代码来源:CGridView.php
示例2: getRenderedDataCellValue
/**
* @param CGridColumn $column
* @param integer $row
*
* @return string
*/
private function getRenderedDataCellValue($column, $row)
{
ob_start();
$column->renderDataCell($row);
return ob_get_clean();
}
开发者ID:zhaoyan158567,项目名称:YiiBooster,代码行数:12,代码来源:TbExtendedGridView.php
示例3: renderHeaderCellContent
protected function renderHeaderCellContent()
{
CGridColumn::renderHeaderCellContent();
}
开发者ID:sundgaarden,项目名称:dashboard,代码行数:4,代码来源:ACheckBoxColumn.php
示例4: renderFooterCell
/**
* Override to handle spanning of row. Used primarily by matrix reports to render a grid
*/
public function renderFooterCell()
{
if (isset($this->footer)) {
return parent::renderFooterCell();
}
return null;
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:YAxisHeaderColumn.php
示例5: 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->grid->enableSorting && $this->sortable && $this->name !== null) {
echo $this->grid->dataProvider->getSort()->link($this->name, $this->header);
} else {
parent::renderHeaderCellContent();
}
}
开发者ID:BGCX261,项目名称:zii-svn-to-git,代码行数:12,代码来源:CDataColumn.php
示例6: 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,代码来源:EGridColumn.php
示例7: init
public function init()
{
parent::init();
$data = $this->grid->dataProvider->getData();
if (count($data) == 0) {
return;
}
$this->link = ObjectUrlRule::createUrlFromCurrent(BackendModule::ROUTE_INSTANCE_LIST, array(ObjectUrlRule::PARAM_OBJECT_PARENT => '{id}'), array(ObjectUrlRule::PARAM_SYSTEM_MODULE, ObjectUrlRule::PARAM_PAGER_NUM, ObjectUrlRule::PARAM_OBJECT_INSTANCE, ObjectUrlRule::PARAM_ACTION_VIEW));
$this->countData = $this->grid->dataProvider->model->getCountChildOfInstances($data);
}
开发者ID:kot-ezhva,项目名称:ygin,代码行数:10,代码来源:FolderColumn.php
示例8: 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->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:DarkAiR,项目名称:test,代码行数:18,代码来源:SelectColumn.php
示例9: renderHeaderCellContent
/**
* Renders the header cell content.
* This method will render a checkbox in the header when {@link CGridView::selectableRows} is greater than 1.
*/
protected function renderHeaderCellContent()
{
if ($this->grid->selectableRows > 1) {
echo CHtml::checkBox($this->id . '_all', false);
} else {
parent::renderHeaderCellContent();
}
}
开发者ID:BGCX261,项目名称:zii-svn-to-git,代码行数:12,代码来源:CCheckBoxColumn.php
示例10: init
public function init()
{
parent::init();
}
开发者ID:rajveer4155,项目名称:vidmgr,代码行数:4,代码来源:indexColumn.php
示例11: renderFilterCellContent
/**
* Renders the filter cell content.
* This method will render the {@link filter} as is if it is a string.
* If {@link filter} is an array, it is assumed to be a list of options, and a dropdown selector will be rendered.
* Otherwise if {@link filter} is not false, a text field is rendered.
* @since 1.1.1
*/
protected function renderFilterCellContent()
{
if ($this->filter !== null) {
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 (is_array($this->filter)) {
echo CHtml::activeDropDownList($this->grid->filter, $this->name, $this->filter, array('id' => false, 'prompt' => ''));
} else {
if ($this->filter === null) {
echo CHtml::activeTextField($this->grid->filter, $this->name, array('id' => false));
}
}
} else {
parent::renderFilterCellContent();
}
}
}
}
开发者ID:rfjaimes,项目名称:awegen,代码行数:27,代码来源:JToggleColumn.php
示例12: renderHeaderCellContent
/**
* Render header cell (can not be 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:rizaldi-github,项目名称:Yii-Playground,代码行数:15,代码来源:XReorderColumn.php
示例13: init
public function init()
{
parent::init();
$arrayOfId = $this->grid->dataProvider->getKeys();
if (count($arrayOfId) == 0) {
return;
}
$availableObjects = array();
$singleStatus = 0;
foreach ($this->childData as $param) {
if ($param->isRelation() == false) {
continue;
}
$idObject = $param->getIdObjectParameter();
// Смотрим, может ли пользователь работать с подчинённым объектом
if (isset($availableObjects[$idObject]) && $availableObjects[$idObject] === null) {
continue;
}
if (!Yii::app()->authManager->checkObject(DaDbAuthManager::OPERATION_LIST, Yii::app()->user->id, $idObject)) {
$availableObjects[$idObject] = null;
continue;
} else {
$singleStatus = $singleStatus == 0 ? 1 : 2;
$availableObjects[$idObject][$param->getIdParameter()]['field'] = $param->getFieldName();
}
}
if ($singleStatus == 2) {
$this->single = false;
$this->htmlOptions = array('class' => 'col-ref action-sub-data');
} else {
$this->htmlOptions = array('class' => 'col-ref-one action-sub-data');
}
foreach ($availableObjects as $idObject => $params) {
if ($params === null) {
unset($availableObjects[$idObject]);
continue;
}
$object = null;
if (count($params) == 1) {
$object = DaObject::getById($idObject, false);
foreach ($params as $idParameter => $caption) {
$availableObjects[$idObject][$idParameter]['caption'] = $object->name;
}
} else {
$object = DaObject::getById($idObject, true);
foreach ($params as $idParameter => $caption) {
$param = $object->getParameterObjectByIdParameter($idParameter);
$availableObjects[$idObject][$idParameter]['caption'] = $object->name . ' (' . $param->caption . ')';
}
}
$model = $object->getModel();
foreach ($params as $idParameter => $config) {
$cr = new CDbCriteria();
$cr->addColumnCondition(array('t.id_object' => $idObject));
$cr->order = 't.order_no';
$objectView = DaObjectView::model()->find($cr);
$dataProvider = Yii::app()->controller->buildDataProvider($objectView, $model);
$where = $dataProvider->criteria->condition;
$params = $dataProvider->criteria->params;
$whereConfig = array('and');
if ($where != null) {
$whereConfig[] = $where;
}
$whereConfig[] = array('in', $config['field'], $arrayOfId);
$data = Yii::app()->db->createCommand()->select($config['field'] . ' AS id, count(*) AS cnt')->from($model->tableName())->where($whereConfig, $params)->group($config['field'])->queryAll();
/*
// многообъектая поддержка
$iq = new InstanceQuery($where);
$arrayOfIdObject = Object::getCommonObjectBySingle($idObjectTmp);
if (count($arrayOfIdObject) > 1) {
$iq->setUsedObjects(array($idObjectTmp));
}*/
$assocData = array();
foreach ($data as $row) {
$assocData[$row['id']] = $row['cnt'];
}
$availableObjects[$idObject][$idParameter]['data'] = $assocData;
}
}
$this->prepareData = $availableObjects;
// TODO: Поменять скрипт, когда будет применяться PopOver
if (!$this->single) {
Yii::app()->clientScript->registerScript('admin.subData.init', '$(".action-sub-data").daSubData();
$(document).on("afterGridUpdate", function(e) { $(".action-sub-data").daSubData(); });
', CClientScript::POS_READY);
/*
Yii::app()->clientScript->registerScript('admin.subData.init', '
$("[rel=\'popover-sub-data\']").popover({
placement: "left",
trigger: "hover",
template: "<div class=\'popover\'><div class=\'arrow\'></div><div class=\'popover-inner\'><div class=\'popover-content\'></div></div></div>"
});', CClientScript::POS_READY);
*/
}
}
开发者ID:Cranky4,项目名称:npfs,代码行数:95,代码来源:RelationsColumn.php
示例14: renderHeaderCellContent
/**
* Renders the header cell content.
* This method will render a checkbox in the header when {@link selectableRows} is greater than 1
* or in case {@link selectableRows} is null when {@link CGridView::selectableRows} is greater than 1.
*/
protected function renderHeaderCellContent()
{
if (trim($this->headerTemplate) === '') {
echo $this->grid->blankDisplay;
return;
}
$item = '';
if ($this->selectableRows === null && $this->grid->selectableRows > 1) {
$item = CHtml::checkBox($this->id . '_all', false, array('class' => 'select-on-check-all'));
} elseif ($this->selectableRows > 1) {
$item = CHtml::checkBox($this->id . '_all', false);
} else {
ob_start();
parent::renderHeaderCellContent();
$item = ob_get_clean();
}
echo strtr($this->headerTemplate, array('{item}' => $item));
}
开发者ID:lucifurious,项目名称:yii,代码行数:23,代码来源:CCheckBoxColumn.php
示例15: getHeaderCellContent
/**
* Returns the header cell content.
* This method will render a checkbox in the header when {@link selectableRows} is greater than 1
* or in case {@link selectableRows} is null when {@link CGridView::selectableRows} is greater than 1.
* @return string the header cell content.
* @since 1.1.16
*/
public function getHeaderCellContent()
{
if (trim($this->headerTemplate) === '') {
return $this->grid->blankDisplay;
}
if ($this->selectableRows === null && $this->grid->selectableRows > 1) {
$item = CHtml::checkBox($this->id . '_all', false, array('class' => 'select-on-check-all'));
} elseif ($this->selectableRows > 1) {
$item = CHtml::checkBox($this->id . '_all', false);
} else {
$item = parent::getHeaderCellContent();
}
return strtr($this->headerTemplate, array('{item}' => $item));
}
开发者ID:omonra,项目名称:blog,代码行数:21,代码来源:CCheckBoxColumn.php
示例16: renderDataCellContent
/**
* Renders the data cell content.
* This method evaluates {@link dataExpression} or {@link dataField} and renders the result.
* @param integer the row number (zero-based)
* @param mixed the data associated with the row
*/
protected function renderDataCellContent($row, $data)
{
if ($this->dataExpression !== null) {
echo $this->evaluateExpression($this->dataExpression, array('data' => $data, 'row' => $row));
} else {
if ($this->dataField !== null) {
$value = CHtml::value($data, $this->dataField);
if ($this->encodeData === true) {
$value = CHtml::encode($value);
}
echo $value;
} else {
parent::renderDataCellContent($row, $data);
}
}
}
开发者ID:BGCX261,项目名称:zii-svn-to-git,代码行数:22,代码来源:CDataColumn.php
示例17: renderHeaderCellContent
/**
* Renders the header cell content.
* This method will render a checkbox in the header when {@link selectableRows} is greater than 1
* or in case {@link selectableRows} is null when {@link CGridView::selectableRows} is greater than 1.
*/
protected function renderHeaderCellContent()
{
if ($this->selectableRows === null && $this->grid->selectableRows > 1) {
echo CHtml::checkBox($this->id . '_all', false, array('class' => 'select-on-check-all'));
} else {
if ($this->selectableRows > 1) {
echo CHtml::checkBox($this->id . '_all', false);
} else {
parent::renderHeaderCellContent();
}
}
}
开发者ID:romeo14,项目名称:pow,代码行数:17,代码来源:CCheckBoxColumn.php
注:本文中的CGridColumn类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论