Pull Chtml::button() To Bottom Of Cgridview Cell

Hi,

I have a CGridview whose one cell I render contents with Buttons. Actually it is a forum application and I have little problem. I have attached first image (Ubuntu forum shot) where a quote button is at the bottom, exactly where I want mine also to be. Second image is mine showing how the quote (and all other buttons) hang depending on text, something I dont want.

Is there a way making buttons stay at the bottom. Since code is massive somehow, I’ll post what I see as relevant code

Here is grid cell


<?php 

            

         $this->widget('bootstrap.widgets.TbGridView', array(

            'dataProvider'=>$postReplies,

            //'type'=>'',

            'emptyText'=>'',

            'summaryText'=>'',

            'template' => "{items}{pager}", 

            'htmlOptions' => array('style' => 'padding:0'),

            'columns'=>array( 

                    array(

                        'header'=>'', 

                        'name'=>'Replies', 

                        'type'=>'raw', 

                        'value'=>array($this, 'userReplierProfile'),

                        'htmlOptions'=>array('width'=>'25%'),

                    ),

                    array(

                        'header'=>'', 

                        'name'=>'UserText',

                         'type'=>'html',

                        'value'=>array($this, 'userReply'),

                        'htmlOptions'=>array('width'=>'75%'),

                    ), 

                ),

        ));?> 

What I want to accomplish

3384

ubuntu.png

What currently looks like

3385

mine.png

Thanks

CGridView may not be the best choice for this. Consider CListView; it would allow you to subdivide each part more easily.

In any case, one option is to relatively position the row that you’re in, then absolutely position the button container to the bottom right. You could do that in your CSS file, assuming that you’ve assigned a class to the containing row and the button container:




.row-class { position:relative; }

.row-class .button-container-class { position:absolute; bottom:1em; right:1em; }



You’ll need to ensure you set suitable margins on the data cell to prevent the buttons from appearing on top of content.

since you have the buttons inside the cell you might need to set the padding: 20px; to your cell in order to prevent that.

The buttons probably can’t be in the data cell itself, because the row height will be defined by the highest of the two cells (user details and data).

Thanks friends for reply. My home internet connection dies for whole day.

Let me apply these and I will be back.

Hi Keith,

where do I set class name for the row? I can set options for cell but not row

http://www.yiiframework.com/doc/api/1.1/CGridView#rowCssClass-detail