Logic In Cgridview

hallo everybody…i have display of cgridview like this :

No | Jenis Surat | Isi | Lihat Surat |

  1. | A | blablabla AA | Lihat |

  2. | B | blablabla BBkj | Lihat |

  3. | C | blablabla CChv | Lihat |

  4. | B | blablabla BBbbb| Lihat |

i want to make action :

  1. when i click "lihat" in row "jenis surat A",. go to page A

  2. when i click "lihat" in row "jenis surat B",. go to page B

  3. when i click "lihat" in row "jenis surat C",. go to page C

Can anyone please let me know how to make logic in controller or model? Any help would be greatly appreciated :unsure:


you can create URL from below code of line

‘url’=>’$this->grid->controller->createUrl(“actionname”, array(“id”=>$data->primaryKey,"_id"=>’.$model->_id.’))’,

thx for your response chandran…

but sorry where should i put that?and how about action in controller?

i try to make like this in cgridview :


					'header'=>'View Naskah',





							//'filter'=>CHtml::activeTextField($model, 'jenisSurat'),


and like this in controller :

public function actionSurmas()







			else if($this->id_jenissurat=2)







but not work…

linkbutton usage


cgridview value is evaluated as expression… please follow the line