1

Yiiの下でbootstrap.widgets.TbGridViewで4列のGridViewを作ってみたらこんな感じ

|name | age | sex | birthday |
|----------------------------|
|(   )|(   )|(   )|(        )|
|----------------------------|
|Lo   |1    |f    |24/05     |

と ( ) は検索ボックスを意味するので、age の検索ボックスを非表示にして、次のようにします。

|name | age | sex | birthday |
|----------------------------|
|(   )|     |(   )|(        )|
|----------------------------|
|Lo   |1    |f    |24/05     |

Yii でそれを行う方法を誰か教えてもらえますか?

$this->widget('bootstrap.widgets.TbGridView', array(
        'type'            => 'condensed',
        'id'              => 'provider-grid',
        'dataProvider'    => $model->search(),
        'filter'          => $model,
        'columns'         => array(
            'name',
            'email',
            array('name' => 'created_at', 'filter' => false), // solved by this
            array('name' => 'updated_at', 'filter' => false), // solved by this
            array(
                'class'        => 'bootstrap.widgets.TbButtonColumn',
                'htmlOptions'  => array(
                    //'nowrap'     => 'nowrap'
                ),
                'template'     => '{login} {view} {update} {delete}', // https://github.com/yiisoft/yii/blob/1.1.13/framework/zii/widgets/grid/CButtonColumn.php#L46
                'buttons'      => array(
                    'login'      => array(
                        'label'    => Yii::t('bus', 'Login to Administrator Site'),
                        'options'  => array(
                            'title'  => Yii::t('bus', 'Login to Administrator Site'),
                            'target' => '_blank'
                        ),
                        'url'      => 'Yii::app()->createUrl(
                            "/administrator/default/index",
                            array(
                                "provider_id" => $data->id
                            )
                        )',
                        'icon'    => 'share'
                    ),
                )
            ),

        ),
    ));
4

1 に答える 1