Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

How To Assign Dynamic Data To Cdatacolumn Htmloptions

$
0
0
I have a CGridView table. I would like to add data-id attribute to the <td> element. Looking at the CDataColumn I have the following column:

'columns'=>array(
                array(
                    'name'  => 'article_title',
                    'value' => '$data->article_id . ". " . $data->article_title',
                    'htmlOptions' => array("data-id" => $model->article_id),
                )
            ),


htmlOptions from the above code fail as $model->article_id is null. How can I access the value of the current data row?

Thanks

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>