Yii Framework Forum: Cgridview With Widgets In New Row Footer - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cgridview With Widgets In New Row Footer Rate Topic: -----

#1 User is offline   chronoss 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 17-December 12

Posted 13 August 2013 - 04:55 PM

Hi,

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?

Thanks
0

#2 User is offline   nineinchnick 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 622
  • Joined: 12-September 11
  • Location:Bialystok, Poland

Posted 14 August 2013 - 07:39 AM

Read the docs: http://www.yiiframew...r#widget-detail

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.
Don't be a dick.
0

#3 User is offline   chronoss 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 17-December 12

Posted 14 August 2013 - 04:06 PM

Thank you, I will try as soon as possible.

Edit: It work with a TRUE added. Thanks :-)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users