Skip to content

Instantly share code, notes, and snippets.

@davialexandre
Created October 20, 2012 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davialexandre/3921652 to your computer and use it in GitHub Desktop.
Save davialexandre/3921652 to your computer and use it in GitHub Desktop.
Exemplo de customização de filtros no CGridView
<?php $this->widget('zii.widgets.grid.CGridView', array(
'columns'=>array(
array(
'name' => 'pesquisa',
'value' => '$data->pesquisa',
'header' => 'Termo',
),
array(
'name' => 'data_cadastro',
'value' => 'Yii::app()->dateFormatter->formatDatetime(strtotime($data->data_cadastro), "short", "short")',
'filter' => CHtml::activeTextField($pesquisa, 'data_cadastro'),
),
array(
'name' => 'id_status',
'value' => '$data->status->status',
'filter' => CHtml::activeDropDownList($pesquisa, 'id_status', CHtml::listData($status, 'id', 'status'), array('prompt'=>'')),
),
),
)); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment