cgrid removing script tags

Hi all

While building a custom version of CGRid

I needed to add a script tag to initialize some attribute in the renderTableRow

my grid is ajax paginated

The inserted scripts run fine for the first page and are well interpreted

but all other pages seem to remove the script tag ?

can someone confirm this ?

is there a work around it ?

It’s my personal opinion, but it’s better to use only the plain html in the contents that will be updated by ajax. It tends to make things messy when you have included scripts in those contents.

I would use an independent javascript function outside the grid to initialize those attributes in the grid. And use ‘afterAjaxUpdate’ to re-initialize them after the ajax calls.

http://www.yiiframework.com/doc/api/1.1/CGridView/#afterAjaxUpdate-detail