Retrieve id value of current Gridview row when image of CbuttonColumn is clicked

Hi community!

I have I think rather a JQuery and Html problem with respect to yii.

I have

  1. A gridview with a cbuttonColumn (my own png-image).

  2. In a click JS function I want to retrieve the id-value of the current row like

    this





  .

  .

  .

  'click'=>"(function(){

                      

                      var rowId = id-value of record in the current row.

                      alert(rowId);


                       }


  .          ),

  .

  .



I do not know how to do this.

Some soulutions like the one found here

http://www.yiiframework.com/forum/index.php/topic/20591-passing-variable-inside-cbuttoncolumn-inside-cgridview/

do not work for me.

Can please someone help me?

When you define your button the button url can be a PHP expression… so you can set there the ID as a parameter - http://www.yiiframework.com/doc/api/1.1/CButtonColumn#buttons-detail

That’s exactly what I was looking for!

Thank you very much mdomba