Commit 0991be84 by Kartik Visweswaran

Raw content return for Grid DataColumn & Column

Need to have a method `getDataCellContent` to return raw parsed data cell content. This is useful when extending these Columns, for processing any other data before formatting via `renderDataCellContent`.
parent 342ba95d
......@@ -114,24 +114,36 @@ class Column extends Object
{
return trim($this->footer) !== '' ? $this->footer : $this->grid->emptyCell;
}
/**
* Renders the data cell content.
* Get the raw data cell content.
* @param mixed $model the data model
* @param mixed $key the key associated with the data model
* @param integer $index the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
* @return string the rendering result
*/
protected function renderDataCellContent($model, $key, $index)
protected function getDataCellContent($model, $key, $index)
{
if ($this->content !== null) {
return call_user_func($this->content, $model, $key, $index, $this);
} else {
return $this->grid->emptyCell;
return null;
}
}
/**
* Renders the data cell content.
* @param mixed $model the data model
* @param mixed $key the key associated with the data model
* @param integer $index the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
* @return string the rendering result
*/
protected function renderDataCellContent($model, $key, $index)
{
return ($this->content !== null) ? $this->getDataCellContent : $this->grid->emptyCell;
}
/**
* Renders the filter cell content.
* The default implementation simply renders a space.
* This method may be overridden to customize the rendering of the filter cell (if any).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment