han2kobo
(Han 2kobo)
1
hallo everybody…i have display of cgridview like this :
No | Jenis Surat | Isi | Lihat Surat |
-
| A | blablabla AA | Lihat |
-
| B | blablabla BBkj | Lihat |
-
| C | blablabla CChv | Lihat |
-
| B | blablabla BBbbb| Lihat |
i want to make action :
-
when i click "lihat" in row "jenis surat A",. go to page A
-
when i click "lihat" in row "jenis surat B",. go to page B
-
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 
Hi,
you can create URL from below code of line
‘url’=>’$this->grid->controller->createUrl(“actionname”, array(“id”=>$data->primaryKey,"_id"=>’.$model->_id.’))’,
han2kobo
(Han 2kobo)
3
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 :
array(
'header'=>'View Naskah',
'name'=>'aksi',
'type'=>'raw',
'value'=>'Chtml::linkButton("Lihat",array(\'submit\'=>array(\'naskah/surmas\',\'id\'=>$data->id_naskah)))',
//'filter'=>CHtml::activeTextField($model, 'jenisSurat'),
),
and like this in controller :
public function actionSurmas()
{
if($this->id_jenissurat=1)
{
$this->redirect(array('A'));
}
else if($this->id_jenissurat=2)
{
$this->redirect(array('B'));
}
else
$this->redirect(array('C'));
}
but not work…