attach a funciton to ajaxbeforeupdate for all cgridviews

Hello,

Can anyone help me if there is a way to make all of the cgridviews in my application to use the function before and after ajax update? Thank you.

[indent][indent]<?php

$jsFunction = 'function(){

                      //some js function code


                     }';

/**

  • Grid view of links and form to create new link

*/

$this->widget(‘zii.widgets.grid.CGridView’, array(

‘id’ => ‘linkGrid’,

‘dataProvider’ => $model->search(),

‘ajaxUpdate’ => true, //‘ajaxVar’ => ajax by default

‘afterAjaxUpdate’ => $jsFunction,

‘beforeAjaxUpdate’ => $jsFunction,

‘filter’ => $model,

‘htmlOptions’ => array(‘class’ => ‘grid-view span-24’),

‘columns’ => array(

'static_link_url',


'static_link_title',

?>[/indent][/indent]

extend CGridView and create your own overriding the default settings

Thank you. It worked.

Hi Gustavo,

How can i extend the afterajaxupdate js code from the extended one so that i can add some more code on a particular grid view?