Commit 342ba95d 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 8001d234
......@@ -134,11 +134,11 @@ class DataColumn extends Column
return parent::renderFilterCellContent();
}
}
/**
* @inheritdoc
* Return raw content
*/
protected function renderDataCellContent($model, $key, $index)
protected function getDataCellContent($model, $key, $index)
{
if ($this->value !== null) {
if (is_string($this->value)) {
......@@ -149,8 +149,16 @@ class DataColumn extends Column
} elseif ($this->content === null && $this->attribute !== null) {
$value = ArrayHelper::getValue($model, $this->attribute);
} else {
return parent::renderDataCellContent($model, $key, $index);
return parent::getDataCellContent($model, $key, $index);
}
return $this->grid->formatter->format($value, $this->format);
return $value;
}
/**
* @inheritdoc
*/
protected function renderDataCellContent($model, $key, $index)
{
return $this->grid->formatter->format($this->getDataCellContent, $this->format);
}
}
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