ajaxlink in cgridview

Hi YII Master,

I need a help about cgridview, I wanna make a button/link(postPone) in cgridview, and it will make a pop-up(something like CJUiDialog) containing 2 field (date and reason),and then will automatically update the data after save…

please advice, and give me some more example…



About a dialog and form, take a look here

Thanks Zaccaria, but I need more info regarding how to call CJuiDialog from CGridView, and pass the value from CGridView to CJuiDialog

You can use a CDataColumn, set the type to raw in order to save the html and give as value the code in the wiki.

Create a subview for button+cgridview, and pass to the subview the model.

// configuring CGridView button column...




        'template'=>'{my_button} {view} {update} {delete}',



                'label'=>'My Button Label',

                'url'=>'...some url (php expression)...',

                'imageUrl'=>'...image url...',












// dialog widget

$this->beginWidget('zii.widgets.jui.CJuiDialog', array(



        'title'=>'Dialog title',





// dialog content here...


Inside a dialog you’ll need to create an CHtml::ajaxLink() or CHtml::ajaxSubmitButton(), which will send data to some controller/action and then update a grid:


It’s just an idea, but not a working example, but I hope it helps ;)