Scrollable Gridview looks simple...
#1
Posted 10 October 2012 - 09:39 AM
Is there any way to make a fixed height gridview scrollable when you display tons of row ??
First I used this extension http://www.yiiframew...llablegridview/ it works well but css is managed by the javascript... impossible to handle it correctly I have many problems of width between columns and header... they are all the time shifted... I tried many things to correct that but I finally gave up.
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.
thanks
#2
Posted 10 October 2012 - 09:52 AM
#3
Posted 10 October 2012 - 10:04 AM
bennouna, on 10 October 2012 - 09:52 AM, said:
sure :
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>layout :
<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 ?
#5
Posted 10 October 2012 - 11:10 AM
#6
Posted 10 October 2012 - 11:22 AM
#8
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>
#9
Posted 10 October 2012 - 12:51 PM
#10
Posted 10 October 2012 - 04:13 PM
Zugluk, on 10 October 2012 - 11:10 AM, said:
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.
#11
Posted 12 October 2012 - 04:15 AM
#12
Posted 13 December 2012 - 09:28 PM
Zugluk, on 12 October 2012 - 04:15 AM, said:
You can share your code?
Help me ?
Thank you!

Help














