· 7 years ago · Aug 20, 2018, 08:10 PM
1how to pass the view id to the CJuiDialog box?
2<?php
3$this->widget('zii.widgets.grid.CGridView',array(
4 'dataProvider'=>$dataProvider,
5 'columns' => array(
6 array(
7 'name' => 'emailaddress',
8 'htmlOptions' => array(
9 'width' => '30',
10 ),
11 ),
12 array(
13 'name' => 'secretkey',
14 'htmlOptions' => array(
15 'width' => '40px',
16 ),
17 ),
18 array(
19 'header' => 'Options',
20 'class' => 'CButtonColumn',
21 'template' => '{view}{update}{delete}',
22 ),
23 array(
24 'header' => 'Copy URLs',
25 'class' => 'CButtonColumn',
26 'template' => '{copy}',
27 'buttons' => array(
28 'copy' => array(
29 'label' => 'copy url',
30 'url' => 'Yii::app()->createUrl("emails/view",array("id"=>$data["emailid"]))',
31 'options' => array('id' => $data["emailid"]),
32 'click' => 'function(){$("#mydialog").dialog("open"); return false;}',
33 )
34 ),
35 ),
36 ),
37));
38
39?>
40
41<?php
42$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
43 'id' => 'mydialog',
44 'options' => array(
45 'title' => 'URL + Key',
46 'autoOpen' => false,
47 'width' => 500,
48 'height' => 300,
49 ),
50));
51
52
53//THIS PART SHOULD RECEIVE THE ID SO THAT I CAN QUERY TO THE DB TABLE
54
55?>
56
57<?php
58$this->endWidget('zii.widgets.jui.CJuiDialog');
59?>
60
61SELECT u.url,e.secretKey FROM tbl_emails AS e, tbl_urls AS u
62WHERE emailid = ID;