Why does the text box disappear below Created By
when I call the value from an other model(admin) relation. How can I get the textbox to display no matter what model relation?
Refer to the screenshot for more information about the problem:
Why does the text box disappear below Created By
when I call the value from an other model(admin) relation. How can I get the textbox to display no matter what model relation?
Refer to the screenshot for more information about the problem:
Yii CGridView doesn't create inputFiled for those columns that aren't part of the tables shown (as occurs with relations). If you want to show a filter box (dropdown, or whatever you want, an easy way is to create a custom CDataColumn an use it in your grid:
array(
'name'=>'customer.createdBy.name',
'header' => 'Created by',
'class' => 'application.modules.mine.components.DataColumnCreatedBy',
),
Now define your extended column to render a filter:
class DataColumnCreatedBy extends CDataColumn
{
public function renderFilterCell()
{
echo "<td>";
echo CHtml::inputField('createdBy');
echo "</td>";
}
}