Scrollable Gridview looks simple...
Posted 10 October 2012 - 09:39 AM
Is there any way to make a fixed height gridview scrollable when you display tons of row ??
Then I tried simply to put my gridview in a div with a fixed height and "overflow-y:auto" css style... but here again it doesn't work... div is well 500px big... but table goes over and no scroll appears...
So is there other way to do it ? or have you an Idea ??
I searched a lot on yii website but I didn't find anything interesting except the extension I talked about. Almost all topics I found were about infinite scroll (like on twitter) but I want a simple one.
Posted 10 October 2012 - 10:04 AM
view for cgridview widget:
<div class="output"> <?php $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'element-grid', 'dataProvider'=>$model->search(), 'filter'=>$model, 'selectableRows' => 2, 'columns'=>array( /*array( 'class' => 'CCheckBoxColumn', 'id'=>'selection', ), 'id',*/ 'element', 'description', ), 'htmlOptions'=>array( 'style'=>'overflow-y:scroll;height:500px;'), )); ?> </div>
<div id="content" class="span-16"> <?php echo $content; ?> </div><!-- content --> </div> <?php $this->endContent(); ?>
for the interesting part...
Shouldn't I apply the overflow on tbody of the gridview instead ?
Posted 10 October 2012 - 11:10 AM
Your link looks interesting but what is the connection with my topic ? it doesn't suggest a way to get a gridview scrollable
Posted 10 October 2012 - 12:51 PM
<div class="output" style="height: 500px; overflow-y: auto"> <?php $this->widget('zii.widgets.grid.CGridView', array( … )); ?> </div>
Posted 10 October 2012 - 04:13 PM
if you just want to make your gridview scrollable it's a simple task with css but fixing the header has some issue so I thought it's fixed header gridview may be usefull for you.
Posted 13 December 2012 - 09:28 PM
You can share your code?
Help me ?