Including Js/ajax Functions

Hello Everyone, Yii newbie here :)

I have tried more than once to figure out a way to include an Ajax/JS function in an easy clean way in my CGRIDVIEW,

the code is basically

'click'=> "function (){

    $.fn.yiiGridView.update('news-grid', {



        success:function(data) {


                opacity: 1.0

            }, 3000).fadeOut('slow');





    return false;


In your opinion, whats the cleanest, most performance benificial way to include this?

Thank you for your time !!!