what i would do ( thought this very quick is ). To the value use an ajax to call a action in ccontroller where i pass the key value of specific row from the data provider. This action will return the html content i want to show in the CJuiDialog and then in the ajax call told before use ‘update’ to update the data in the CJuiDialog. THEN i would dialog(“open”);
You don’t need/can not add CJuiDialog in the code of CGridView. There is NO need for this.
Create an empty CJuiDialog.
Create CGridView and use an CHtml::ajaxLink to display the name of a person for example.
2.1. In the ajaLink what you have to do is 2~3 things.
2.2. Make an async call to your controller action…(let’s name it )…actionMyDialog
2.3. When you create the url for this ajaxlink you know the id of the specific person, you can get this id the same way you get his name to display it . So what are you going to do with this id?! Send it with GET or POST to the actionMyDialog when you create the url.
Create actionMyDialog. This actions wait for a $_GET or $_POST [‘id’] take this find what you want to find and echo html code similar to rendering partial something. When this action ends, what happens is that we return to the ajaxLink and ‘success’ option. WHERE we use jquery to append and then open the dialog.
Some tips…use ids for what has to do with ajax, and remove the data form the CJuiDialog <div> before you append other ( this can be done in similar way i think it’s jquery remove when you close the dialog.)