I have a problem with CGridView, the grid show the textbox filter but when i tip something and then press confirm, the grid doesn't filter the data.
here is my code
/*the Controller*/ $dataProvider=new CActiveDataProvider('DMSenha', array( 'criteria'=>array( 'select'=>'t.id_vida, t.id_senha, count(id_senha) as total_senhas', 'join'=>'LEFT JOIN vida as v ON (v.id_vida = t.id_vida)', 'group'=>'t.id_vida', 'order'=>'v.nome_vida', 'with'=>array('vida'), 'together'=>'true', ), ) ); $this->render('index',array( 'dataProvider'=>$dataProvider, ));
/*the View*/ $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=> $dataProvider, 'filter'=>DMSenha::model(), 'columns'=>array( 'vida.cod_vida', array( 'name'=>'vida', 'filter' => CHtml::textField('vida.nome_vida'), 'value' => 'DMVida::Model()->FindByPk($data->id_vida)->nome_vida', ), 'total_senhas', ), 'id'=>'gridsenha', 'selectableRows'=>1, 'selectionChanged'=>'function(id){ $id_senha = $(\'#gridsenha\').yiiGridView.getSelection(id); $(\'#hload\').ajaxStart(function(){$(this).show();}); $(\'#hload\').ajaxStop(function(){$(this).hide();}); $(\'#diagDialog\').remove(); $(\'#detailAjax\').load("'.$this->createUrl('/GestaoIntercorrencias/dCSenha/detailItem').'/id/"+$id_senha); }' , ));
/*The Relation in DMSenha*/ 'vida' => array(self::BELONGS_TO, 'DMVida', 'id_vida'),
I need to filter the vida.nome_vida and vida.cod_vida columns.
I have already looked at the forum and over the internet, but i didnt find any solution.
Can anyone help me with that ?
Thanks