id attribute in CGridColumn is not loaded

Hi:

I’m trying to use the attribute “id” in a specific cell , but it’s not working.

If I put the "id" in the htmlOptions array works, but there the strings are not "evaluate" and I can not use the dataprovider data.

My need is that I need to set the "id" of the cells based to one of my data (for example, id = "cell-".$data->id, instead of doing with the "span" inside as the example shows.

Thank you in advance




$this->widget('zii.widgets.grid.CGridView',

    array(

        'id'           => 'documentoCGridView',

        'dataProvider' => $dataProvider,

        'columns'      => array(

            array(

                'id'  => '$data->id',

                'name'  => 'Comentario',

                'type'  => 'raw',

                'value' => '"<span id=\"editable-com-" . $data->id . "\">" . $data->coment . "</span>"', 

'htmlOptions' => array("class" => "editable"  )

            ),

        )

    )

);

‘id’ property of CGridColumn is for header cell, not for data cells …

We have to work around it as you are doing, or maybe by using ‘cssClassExpression’ property.