jayant
(Codesutras)
December 12, 2011, 1:36pm
1
Hi All,
I am getting some problem with a CGridView.
Column are not showing in proper format in Google chrome. I am using a default layout “Column2” and my Gii Generated CRUD CGrid view is not displaying proper with 2 column layout.
I have tried a htmlOptions also for a columns.
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'script-grid',
'dataProvider'=>$model->search(),
//'filter'=>$model,
'enableSorting'=>false,
'columns'=>array(
array('name'=>'id',
'htmlOptions'=>array('width'=>'40px'),
),
array('name'=>'code',
'htmlOptions'=>array('width'=>'40px'),
),
'position',
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
)),
)); ?>
But still not able to fix this problem in Google chrome. CGrid View is displaying fine in FF but it not proper in GOOGLE CHROME.
Anybody can help me…
Thanks in Advance !!
Revekius
(Avaland)
September 11, 2012, 2:17am
2
jayant:
Hi All,
I am getting some problem with a CGridView.
Column are not showing in proper format in Google chrome. I am using a default layout “Column2” and my Gii Generated CRUD CGrid view is not displaying proper with 2 column layout.
I have tried a htmlOptions also for a columns.
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'script-grid',
'dataProvider'=>$model->search(),
//'filter'=>$model,
'enableSorting'=>false,
'columns'=>array(
array('name'=>'id',
'htmlOptions'=>array('width'=>'40px'),
),
array('name'=>'code',
'htmlOptions'=>array('width'=>'40px'),
),
'position',
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
)),
)); ?>
But still not able to fix this problem in Google chrome. CGrid View is displaying fine in FF but it not proper in GOOGLE CHROME.
Anybody can help me…
Thanks in Advance !!
Hi did you ever solve this issue with chrome? I have encountered the same issue.
abennouna
(Abennouna)
September 11, 2012, 4:19am
3
Hello,
What’s the issue you’re encountering exactly?
Revekius
(Avaland)
September 11, 2012, 4:21am
4
Actually it is the same issue as listed above. You can see an image of it here:
The layout in chrome doesn’t fit on the screen whereas on firefox it does.
Thanks,
Aaron
abennouna
(Abennouna)
September 11, 2012, 5:43am
5
Hi again Aaron,
You have probably to:
[list=1]
[*]set the widget’s table width
[*]set the widget’s table ‘table-layout’ CSS property to fixed
[*]set the relevant column widths
[/list]
See http://stackoverflow.com/questions/1057574/html-td-wrap-text
You can also post CGridView code in any case.
Cheers
Revekius
(Avaland)
September 11, 2012, 6:27am
6
Excellent, that fixed it! Applying -
table-layout:fixed
to the table worked.
Thanks! =)
Aaron