hi!
I have one problem with one column in a gridview, I want aplicate de parameter "visible" in function with one value from other model, for this I create one function in a model
public function getVisible(){
$model = new TbEntiPerServicio;
$mostrar = false;
$valor1 = $this->ID_SERVICIO; //number of service
$valor2 = $this->iDSERVICIO->VISIBLE; //state of the service coming from other model relationated
$valor3 = $this->iDSERVICIO->ID_SERVICIOS; //number of service from the other model relationated
if ($valor1 == $valor3 && $valor2 == 1){
$mostrar = true;
return self:: $mostrar;
}
}
and in the gridview I have this
array (
'name'=>'ID_SERVICIO',
'value'=>'CHtml::link($data["1"],Yii::app()->createUrl("/TbEntiPerServicio/detalleview", array("id"=>$data["ID_ENTI_PER_SERV"],"id_entidad"=>$data["ID_ENTI"],"id_servicio"=>"1")))',
//'value'=>'$data["1"]',
'visible'=>'$data->getVisible()', //this option for hide the column
'type'=>'raw',
),
where is the problem?, because don’t happens nothing, I tray and tray …
thanks a lot!, and sorry for my english