Cgridview With Widgets In New Row Footer


I am new using Yii and I wonder if there is a way to add widgets to a CGridView footer. I want to build a footer that let me add new rows to the CGridView.

I am able to add Html simple controls using for example

'footer' => CHtml::textField()

But when I try to add a widget for autocomplete

'footer' => $this->widget('zii.widgets.jui.CJuiAutoComplete'...)

it returns me an error:

trim() expects parameter 1 to be string, object given

The only way is to extends CDataColumn and overridden each column with a custom class?


Read the docs:

There is a third parameter to the widget() method that makes it return the widget output instead of echo’ing it and returning the widget object.

Thank you, I will try as soon as possible.

Edit: It work with a TRUE added. Thanks :slight_smile: