Hi guys!
I have this code in my admin.php in the views:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'empresas-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
array(
'name'=>'Nome',
'value'=>'Entidades::model()->findByPk($data->Id)->Nome',
),
array(
'name'=>'IdCategoria',
'filter' => CHtml::listData(EmpresasCategorias::model()->findAll(), 'Id', 'Nome'),
'value'=> 'EmpresasCategorias::model()->findByPk($data->IdCategoria)->Nome',
),
'Site',
'Detalhes',
array(
'class'=>'CButtonColumn',
),
),
)); ?>
But it has a problem with IdCategoria, it doesn’t apply a FULL MATCH on the ID, instead it does something like this:
if IdCategoria is 1, he will find all IdCategoria’s that have a ‘1’ in it, so search results will be 1,12,321,313,etc… anything with a ‘1’. How can i force it to full match it?
Thanks!