<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'properties-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'ref',
array(
'name'=>'type1',
'filter'=> CHtml::textField('type1',$model->type1,array('size'=>10)),
),
............
Somehow I can't change the column size in CGridView
#21
Posted 28 October 2011 - 03:30 AM
If you specify a custom filter on each column, you can include the size of the input box.
#22
Posted 20 January 2012 - 03:45 AM
At least use headerHtmlOptions when setting column specific settings, you don't need to set the width for each and every td.
Yii-Environment Extension - Predefine configurations for use in different environments, like development, testing, staging and production.
NetBeans IDE and Yii projects - Short directions and general tips for managing a Yii application in NetBeans IDE
NetBeans IDE and Yii projects - Short directions and general tips for managing a Yii application in NetBeans IDE
#23
Posted 26 January 2012 - 11:41 PM
This really is more of a html problem than a CGridView problem. What you need is the table-layout:fixed; rule in your table tag, and overflow with a with rule in your td tag.
http://stackoverflow.com/questions/1057574/html-td-wrap-text
http://stackoverflow.com/questions/1057574/html-td-wrap-text
#24
Posted 11 January 2013 - 01:06 AM
Neither of these worked for me...
At least solved by adding max-wdith to css in assets\ff2aa0ca\gridview\style.css
At least solved by adding max-wdith to css in assets\ff2aa0ca\gridview\style.css
grid-view table.items th, .grid-view table.items td
{
font-size: 0.9em;
border: 1px white solid;
padding: 0.3em;
max-width: 115px;
}
Attached File(s)
-
grid_resize.png (23.1K)
Number of downloads: 10
#25
Posted 29 January 2013 - 02:29 PM
wsmits, on 29 April 2011 - 07:48 AM, said:
...
I need to figure out how to add a class to each individual filter textbox to let this resizing work.
I need to figure out how to add a class to each individual filter textbox to let this resizing work.
Excuse my English.
I had the same problem. Using htmlOptions in grid helped only for columns without filter field.
I tried in my styles.css:
.grid-view table.items tr.filters td
{
width: 50px;
}
And it helped.
- I use bootstrap.widgets.TbGridView
- no width in 'htmlOptions' in Grid
- and 50px is minimum width of columns, real width depends propably on lenght of data. If I want more px, then I use width in 'htmlOptions'.
'htmlOptions'=>array('style'=>'width:100px;'),
#26
Posted 15 June 2013 - 05:26 AM
hi friend if i write a comment like
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
than how to set it in grid column in a width is there is any option just to ignore wordwrap.?
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
than how to set it in grid column in a width is there is any option just to ignore wordwrap.?

Help













